From 20438d2011e179a0477941bb5d3e9bb284b8d94a Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 20 Sep 2021 14:11:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=94=AF=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/core/4.widget.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 318c48daf..3c76213ab 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -200,9 +200,12 @@ }, __watch: function (getter, handler, options) { + var self = this; if (_global.Fix) { this._watchers = this._watchers || []; - var watcher = new Fix.Watcher(null, BI.bind(getter, this), (handler && BI.bind(handler, this)) || BI.emptyFn, options); + var watcher = new Fix.Watcher(null, BI.bind(getter, this), (handler && function () { + handler.call(self, self); + }) || BI.emptyFn, options); this._watchers.push(watcher); return watcher.value; } else { From d6c6147187e65ae3f09f0991f7dc79dee45d09a5 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 20 Sep 2021 14:13:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=94=AF=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/core/4.widget.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 3c76213ab..cdb9c213d 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -171,9 +171,9 @@ this.element.addClass(o.cls); } } - if (o.key != null) { - this.element.attr("key", o.key); - } + // if (o.key != null) { + // this.element.attr("key", o.key); + // } if (o.attributes) { this.element.attr(o.attributes); }