From fd6caa7281c052f26e984a8d2e822370f283e1a3 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 9 Feb 2021 23:05:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=88=E5=AF=B9=E7=A7=BB=E5=8A=A8=E7=AB=AFre?= =?UTF-8?q?m=E8=BF=9B=E8=A1=8C=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/shortcut.js | 1 + src/core/widget.js | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/shortcut.js b/src/core/shortcut.js index f160ce95f7..9f3b8492b7 100644 --- a/src/core/shortcut.js +++ b/src/core/shortcut.js @@ -24,6 +24,7 @@ } var widget = new cls(); widget._initProps(config); + widget._constructed(); widget._initRoot(); // if (!lazy || config.element || config.root) { widget._lazyConstructor(); diff --git a/src/core/widget.js b/src/core/widget.js index 919d3edbea..a1c2f02972 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -36,8 +36,12 @@ }); }, - // 覆盖父类的_constructor方法,widget不走ob的生命周期 _constructor: function () { + + }, + + // 覆盖父类的_constructor方法,widget不走ob的生命周期 + _constructed: function () { if (this.setup) { pushTarget(this); this.service = this.setup(); @@ -47,8 +51,8 @@ }, _lazyConstructor: function () { - if (!this._constructed) { - this._constructed = true; + if (!this.__constructed) { + this.__constructed = true; this._init(); this._initRef(); }