From dc906b2a5255354302411aba88eff95685833983 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 5 Sep 2022 13:10:34 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E5=86=85=E5=AD=98=E6=BA=A2=E5=87=BA?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/4.widget.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 80522bb79..df560dc24 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -392,7 +392,7 @@ */ _mount: function (force, deep, lifeHook, predicate, layer) { var self = this; - if (!force && (this._isMounted || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) { + if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) { return false; } layer = layer || 0; @@ -748,7 +748,16 @@ this.purgeListeners(); }, + _assetMounted: function () { + if (!this.isVisible()) { + this._setVisible(true); + this._mount(false, false, false); + this._setVisible(false); + } + }, + _empty: function () { + this._assetMounted(); BI.each(this._children, function (i, widget) { widget && widget._unMount && widget._unMount(); }); @@ -790,6 +799,7 @@ }); }); this._watchers && (this._watchers = []); + this._assetMounted(); this.__d(); this.element.empty(); this.element.unbind(); @@ -799,6 +809,7 @@ }, _destroy: function () { + this._assetMounted(); this.__destroy(); this.element.destroy(); this.purgeListeners(); @@ -806,6 +817,7 @@ destroy: function () { var self = this, o = this.options; + this._assetMounted(); this.__destroy(); if (o.animation) { this._innerSetVisible(false);