5
我目前正在使用Google Polymer構建控件。我想知道是否有可能從元素外部聽取房地產變化事件。我目前使用的解決方法是在調用propertyChanged方法時觸發顯式事件,以便從其他元素偵聽。Google聚合物:聆聽元素外部的財產變化
// Property change in child element
Polymer('some-input', {
valueChanged: function() {
this.fire('valueChanged', this.value)
}
});
[...]
// Listening in the parent element
ready: function() {
this.$.someinput.addEventListener('valueChanged', function(evt) {
var value = evt.detail;
[...]
});
}
您是否知道我是否可以直接收聽財產變更事件?
感謝, 佩德羅
鏈接已死:( – leech