1
这是一个基本的Hello World世界Web组件。当属性“who”被更改时,attributeChangedCallback不会被触发。检查小提琴Webcomponents:attributeChangedCallback not fired
MyElementProto.attributeChangedCallback = function(attr, oldVal, newVal) {
console.log('attributeChangedCallback triggered');
if (attr === 'who') {
this.setWho(newVal);
}
};
https://jsfiddle.net/y3kj81nz/5/