Browse Source

无jira任务 watch顺序

es6
imp 3 years ago
parent
commit
1a0f5681b6
  1. 14
      dist/fix/fix.compact.js
  2. 5
      src/core/4.widget.js

14
dist/fix/fix.compact.js vendored

@ -146,18 +146,12 @@
needPop && popTarget(); needPop && popTarget();
}; };
var _render = BI.Widget.prototype._render; var __initWatch = BI.Widget.prototype.__initWatch;
BI.Widget.prototype._render = function () { BI.Widget.prototype.__initWatch = function () {
var needPop = false; __initWatch.apply(this, arguments);
if (_global.Fix && this._store) {
needPop = true;
pushTarget(this.store);
}
_render.apply(this, arguments);
if (_global.Fix && this._store) { if (_global.Fix && this._store) {
initWatch(this, this.watch); initWatch(this, this.watch);
} }
needPop && popTarget();
}; };
var unMount = BI.Widget.prototype.__d; var unMount = BI.Widget.prototype.__d;
@ -183,7 +177,7 @@
delete this.__cacheStore; delete this.__cacheStore;
}; };
_.each(["__afterRender", "_mount", "__afterMount"], function (name) { _.each(["_render", "__afterRender", "_mount", "__afterMount"], function (name) {
var old = BI.Widget.prototype[name]; var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () { old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store); this.store && pushTarget(this.store);

5
src/core/4.widget.js

@ -319,6 +319,10 @@
this._isMounted = false; this._isMounted = false;
}, },
__initWatch: function () {
// initWatch拦截的方法
},
_initElement: function () { _initElement: function () {
var self = this; var self = this;
this.__isMounting = true; this.__isMounting = true;
@ -328,6 +332,7 @@
if (BI.isPlainObject(els)) { if (BI.isPlainObject(els)) {
els = [els]; els = [els];
} }
this.__initWatch();
if (BI.isArray(els)) { if (BI.isArray(els)) {
BI.each(els, function (i, el) { BI.each(els, function (i, el) {
if (el) { if (el) {

Loading…
Cancel
Save