3
我的代碼:聚合物觀察者不會觸發
<google-youtube currenttime="{{videoTime}}" video-id="{{videoUrl}}"></google-youtube>
<script>
Polymer({
is: 'youtube-video',
properies: {
videoUrl: String,
videoTime: {
type: Number,
observer: 'timeChanged'
}
},
timeChanged: function(){
console.log('observer');
}
});
</script>
聚合物督元素:https://elements.polymer-project.org/elements/google-youtube
的timeChanged
功能不會被調用。爲什麼?
在此先感謝;)
代碼對我來說看起來不錯,你是否試圖將當前時間綁定到span標籤以查看它實際上在工作?我懷疑這個元素可能有錯誤 – Cristian
你的意思是'google-youtube'元素? –
是的,我可以看到'google-youtube'元素沒有任何適當的測試(對於1.0),並且'currenttime'屬性被'self.currenttime = value'改變,而不是'this.set('currenttime ',價值)'。因此我懷疑那裏有一個bug。 – Cristian