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(); }