From 72cab4136dca0addb5f5c9a8f308759103bcf73a Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 11 Mar 2022 10:36:08 +0800 Subject: [PATCH] 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(); },