0
有没有什么方法可以检测组件内容何时更改?检测Ractive.js中的组件内容更改
例如:
HTML:
<component>
<div>{{name}}</div>
</component>
JS:
component = Ractive.extend({
on...: function() {
// invoked when the inner HTML changes
}
});
我使用{{yield}}
因此将其含量在父的上下文中呈现。
现在,我将不得不通过name
到组件,只是为了观察更改(即使我不需要组件上下文中的值)。 (或者我会添加一个我可以调用的函数)。
<component changes="{{name}}">
<div>{{name}}</div>
</component>
任何想法?