我知道该attached
函数不能保证将加载属性。
现在,我一直在使用一个computed
依赖于属性的函数,但是它很笨重。
我也使用过,async
但是我发现它是不一致和任意的(只是选择一个随机的时间来延迟)。
我找不到有关解决此问题的正确方法的任何信息。
您可以使用观察者。
例如你
properties:{
someproperty:{type:Number,observer:'change'}
},
change:function(){
//this function called when the property changes.
}
有关更多信息,请参见https://www.polymer-project.org/1.0/docs/devguide/properties.html
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句