fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
928 B

7 years ago
var model = Fix.define({
7 years ago
name: 1,
arr: [{
n: 'a'
}, {
n: 'b'
}]
7 years ago
});
7 years ago
Demo.Computed = BI.inherit(Fix.VM, {
7 years ago
computed: {
b: function () {
7 years ago
return this.name + 1
7 years ago
},
c: function () {
7 years ago
return this.arr[1].n + this.b
7 years ago
}
7 years ago
}
7 years ago
})
Demo.Store = BI.inherit(Fix.VM, {
_init: function () {
7 years ago
this.comp = new Demo.Computed(model).model;
7 years ago
},
computed: {
b: function () {
7 years ago
return this.comp.c + 1
}
7 years ago
},
7 years ago
actions: {
7 years ago
run: function () {
7 years ago
this.comp.name = 2;
this.comp.arr[1].n = "c"
7 years ago
}
}
});
7 years ago
7 years ago
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
7 years ago
return new Demo.Store();
7 years ago
},
watch: {
b: function () {
debugger;
}
},
mounted: function () {
7 years ago
7 years ago
this.store.run()
}
});
BI.shortcut("demo.fix", Demo.Fix);