From 304423c370ae99202e2aac3c493b15db3c749f0c Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 6 Mar 2022 14:50:45 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20items=E5=92=8Cvalue=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=87=AA=E5=8A=A8watch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/0.single.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index a98736561..bb926e9a2 100644 --- a/src/base/single/0.single.js +++ b/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 () {