From c428e5e3a7103fd87a01474f981a4ecf0d2f05d5 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 11 Jul 2021 22:29:18 +0800 Subject: [PATCH 1/3] bugfix --- src/core/4.widget.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 662ddb8775..3b796aba79 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -300,10 +300,8 @@ this._isMounted = true; for (var key in this._children) { var child = this._children[key]; - if (layer === 0) { - !self.isEnabled() && child._setEnable(false); - self.isValid() && child._setValid(false); - } + !self.isEnabled() && child._setEnable(false); + self.isValid() && child._setValid(false); child._mount && child._mount(deep ? force : false, deep, lifeHook, predicate, layer + 1); } this._mountChildren && this._mountChildren(); From 52c815c34199e7701b1ab351bb08b4d4506dd378 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 11 Jul 2021 22:38:36 +0800 Subject: [PATCH 2/3] bugfix --- src/core/4.widget.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 3b796aba79..c56b8a30eb 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -40,7 +40,7 @@ cls: "", css: null, - vdom: false, + vdom: false }); }, @@ -170,9 +170,9 @@ this.element = BI.Widget._renderEngine.createElement(this); } this.element._isWidget = true; - var widgets = this.element.data("_Widgets") || []; - widgets.push(this); - this.element.data("_Widgets", widgets); + // var widgets = this.element.data("_Widgets") || []; + // widgets.push(this); + // this.element.data("_Widgets", widgets); this._initCurrent(); }, @@ -237,7 +237,7 @@ element.empty(); BI.each(BI.jQuery(self.vnode.elm).children(), function (i, node) { element.append(node); - }) + }); } else { BI.each(els, function (i, el) { if (el) { @@ -268,7 +268,7 @@ BI.each(els, function (i, el) { if (el) { var w = BI._lazyCreateWidget(el, { - element: container, + element: container }); self.addWidget(w); } @@ -300,8 +300,10 @@ this._isMounted = true; for (var key in this._children) { var child = this._children[key]; - !self.isEnabled() && child._setEnable(false); - self.isValid() && child._setValid(false); + if (layer === 0) { + !self.isEnabled() && child._setEnable(false); + !self.isValid() && child._setValid(false); + } child._mount && child._mount(deep ? force : false, deep, lifeHook, predicate, layer + 1); } this._mountChildren && this._mountChildren(); From ef718ad88a4fc0feb907de5839022dfc3c5b212c Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 11 Jul 2021 22:40:00 +0800 Subject: [PATCH 3/3] bugfix --- src/core/4.widget.js | 6 +++--- src/core/element2Snabbdom.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index c56b8a30eb..b885100ffa 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -170,9 +170,9 @@ this.element = BI.Widget._renderEngine.createElement(this); } this.element._isWidget = true; - // var widgets = this.element.data("_Widgets") || []; - // widgets.push(this); - // this.element.data("_Widgets", widgets); + var widgets = this.element.data("__widgets") || []; + widgets.push(this); + this.element.data("__widgets", widgets); this._initCurrent(); }, diff --git a/src/core/element2Snabbdom.js b/src/core/element2Snabbdom.js index b568c2a7b3..f4efcaaa03 100644 --- a/src/core/element2Snabbdom.js +++ b/src/core/element2Snabbdom.js @@ -31,7 +31,7 @@ on: on, hook: { create: function () { - BI.each(BI.Widget._renderEngine.createElement(parentNode).data("_Widgets"), function (i, w) { + BI.each(BI.Widget._renderEngine.createElement(parentNode).data("__widgets"), function (i, w) { w.element = BI.Widget._renderEngine.createElement(vnode.elm); }); }