假设:
Polymer({
firstName: 'John',
lastName: 'Smith',
computed: {
name: '{{firstName}} {{lastName}}'
},
firstNameChanged: function() {
console.log('firstNameChanged')
},
lastNameChanged: function() {
console.log('lastNameChanged')
},
nameChanged: function() {
console.log('nameChanged')
},
如果更改firstName
或lastName
,则firstNameChanged
和lastNameChanged
将会触发,但nameChanged
永远不会触发。有谁知道为什么以及如何解决它?
我在Polymer 0.5.x上,仅供参考。