diff --git a/dist/fix/fix.compact.js b/dist/fix/fix.compact.js index 69a0a3196..a2df708a6 100644 --- a/dist/fix/fix.compact.js +++ b/dist/fix/fix.compact.js @@ -146,18 +146,12 @@ needPop && popTarget(); }; - var _render = BI.Widget.prototype._render; - BI.Widget.prototype._render = function () { - var needPop = false; - if (_global.Fix && this._store) { - needPop = true; - pushTarget(this.store); - } - _render.apply(this, arguments); + var __initWatch = BI.Widget.prototype.__initWatch; + BI.Widget.prototype.__initWatch = function () { + __initWatch.apply(this, arguments); if (_global.Fix && this._store) { initWatch(this, this.watch); } - needPop && popTarget(); }; var unMount = BI.Widget.prototype.__d; @@ -183,7 +177,7 @@ delete this.__cacheStore; }; - _.each(["__afterRender", "_mount", "__afterMount"], function (name) { + _.each(["_render", "__afterRender", "_mount", "__afterMount"], function (name) { var old = BI.Widget.prototype[name]; old && (BI.Widget.prototype[name] = function () { this.store && pushTarget(this.store); diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 90ea28ad8..c104a03c5 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -319,6 +319,10 @@ this._isMounted = false; }, + __initWatch: function () { + // initWatch拦截的方法 + }, + _initElement: function () { var self = this; this.__isMounting = true; @@ -328,6 +332,7 @@ if (BI.isPlainObject(els)) { els = [els]; } + this.__initWatch(); if (BI.isArray(els)) { BI.each(els, function (i, el) { if (el) {