From 8c1bff398b5e0170d685ce1c343587cf29a1b8c8 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 15 Feb 2021 09:57:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/widget.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/core/widget.js b/src/core/widget.js index c094bfc35..3f2779c63 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -7,7 +7,7 @@ */ !(function () { - function callLifeHook (self, life) { + function callLifeHook(self, life) { var hook = self.options[life] || self[life]; if (hook) { var hooks = BI.isArray(hook) ? hook : [hook]; @@ -197,9 +197,11 @@ } if (BI.isArray(els)) { BI.each(els, function (i, el) { - BI._lazyCreateWidget(el, { - element: self - }); + if (el) { + BI._lazyCreateWidget(el, { + element: self + }); + } }); } // if (this._isRoot === true || !(this instanceof BI.Layout)) { @@ -532,12 +534,12 @@ BI.Widget.context = context = contextStack.pop(); }; - function pushTarget (_current) { + function pushTarget(_current) { if (current) currentStack.push(current); BI.Widget.current = current = _current; } - function popTarget () { + function popTarget() { BI.Widget.current = current = currentStack.pop(); }