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.

49 lines
1.2 KiB

7 years ago
(function () {
7 years ago
var State = BI.inherit(Fix.Model, {
7 years ago
state: function () {
return {
name: "原始属性"
7 years ago
};
7 years ago
},
computed: {
b: function () {
7 years ago
return this.model.name + "-计算属性";
7 years ago
}
}
7 years ago
});
7 years ago
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
return new State();
},
watch: {
b: function () {
7 years ago
this.button.setText(this.model.b);
7 years ago
}
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
7 years ago
self.model.name = "这是改变后的属性";
7 years ago
},
text: this.model.b
}
}]
7 years ago
};
7 years ago
},
mounted: function () {
}
});
7 years ago
BI.shortcut("demo.fix_state", Demo.Fix);
7 years ago
}());