Browse Source

Pull request #2534: 无JIRA任务 feature: items和value支持自动watch

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '2057aace8ab19f598247b066db977cd028885110':
  feature: items和value支持自动watch
es6
guy 3 years ago
parent
commit
9d8fe05558
  1. 8
      src/base/single/0.single.js

8
src/base/single/0.single.js

@ -46,8 +46,11 @@ BI.Single = BI.inherit(BI.Widget, {
},
_init: function () {
BI.Single.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
self.setValue(newValue);
}) : o.value;
BI.Single.superclass._init.apply(this, arguments);
if (BI.isKey(o.title) || BI.isKey(o.warningTitle)
|| BI.isFunction(o.title) || BI.isFunction(o.warningTitle)) {
this.enableHover({
@ -55,9 +58,6 @@ BI.Single = BI.inherit(BI.Widget, {
container: o.container
});
}
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
self.setValue(newValue);
}) : o.value;
},
_clearTimeOut: function () {

Loading…
Cancel
Save