组件双向绑定
<button ev-click={self.add}>+1</button>
var Component = Intact.extend({
return {value: 0};
add: function() {
this.set('value', this.get('value') + 1);
});
Intact.extend({
template: template,
defaults: function() {
return {count: 0};
},
_init: function() {
this.Component = Component;
}
});
var Component = self.Component;
<div>
<Component v-model="count" />
count属性值为:{self.get('count')}
</div>
Intact.extend({
template: template,
_init: function() {
this.Component = Component;
}
});