From 7600bc26a4003513b38b66af1ea10f970e03413b Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 10 Mar 2022 21:34:26 +0800 Subject: [PATCH 1/3] chore: bugfix --- dist/fix/fix.compact.js | 4 ++-- src/core/4.widget.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/fix/fix.compact.js b/dist/fix/fix.compact.js index 88148367c..87d22bd83 100644 --- a/dist/fix/fix.compact.js +++ b/dist/fix/fix.compact.js @@ -150,8 +150,8 @@ } }; - var unMount = BI.Widget.prototype.__d; - BI.Widget.prototype.__d = function () { + var unMount = BI.Widget.prototype.__destroy; + BI.Widget.prototype.__destroy = function () { try { unMount.apply(this, arguments); } catch (e) { diff --git a/src/core/4.widget.js b/src/core/4.widget.js index bddc7caba..60e642db3 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -753,7 +753,7 @@ this.__d(); this.element.empty(); this.element.unbind(); - this._initCurrent(); + // this._initCurrent(); this._init(); this._mount(); // this._initRef(); From 5b4f9e308f6ebaa36226e90933c80034d06102fb Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 11 Mar 2022 10:15:42 +0800 Subject: [PATCH 2/3] chore: bugfix --- dist/fix/fix.compact.js | 4 ++++ src/core/4.widget.js | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dist/fix/fix.compact.js b/dist/fix/fix.compact.js index 87d22bd83..b8e49eb28 100644 --- a/dist/fix/fix.compact.js +++ b/dist/fix/fix.compact.js @@ -105,6 +105,10 @@ if (workerMode && this._worker) { return; } + if (this.store) { + pushTarget(this.store); + return true; + } if (this._store) { var store = findStore(this.options.context || this._parent || this.options.element || this._context); if (store) { diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 60e642db3..597e344ff 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -755,7 +755,6 @@ this.element.unbind(); // this._initCurrent(); this._init(); - this._mount(); // this._initRef(); }, From 72cab4136dca0addb5f5c9a8f308759103bcf73a Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 11 Mar 2022 10:36:08 +0800 Subject: [PATCH 3/3] chore: bugfix --- src/core/4.widget.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 597e344ff..4ddfda34c 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -750,10 +750,19 @@ // } // this._isMounted = false; // this.purgeListeners(); + + // 去掉组件绑定的watcher + BI.each(this._watchers, function (i, unwatches) { + unwatches = BI.isArray(unwatches) ? unwatches : [unwatches]; + BI.each(unwatches, function (j, unwatch) { + unwatch(); + }); + }); + this._watchers && (this._watchers = []); this.__d(); this.element.empty(); this.element.unbind(); - // this._initCurrent(); + this._initCurrent(); this._init(); // this._initRef(); },