From 680777573f2924b9657895dd98c038581a52ed0d Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 13 Dec 2017 20:58:03 +0800 Subject: [PATCH] update --- dist/fix/fix.compact.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dist/fix/fix.compact.js b/dist/fix/fix.compact.js index b1c8cb25e..9f630ac3c 100644 --- a/dist/fix/fix.compact.js +++ b/dist/fix/fix.compact.js @@ -60,14 +60,20 @@ widget.__cacheStore = p.store; return p.__cacheStore || p.store; } - throw new Error("找不到store"); } var _init = BI.Widget.prototype._init; BI.Widget.prototype._init = function () { var needPop = false; if (window.Fix && this._store) { + var store = findStore(this.options.element); + if (store) { + pushTarget(store); + needPop = true; + } this.store = this._store(); + needPop && popTarget(); + needPop = false; pushTarget(this.store); if (this.store instanceof Fix.Model) { this.model = this.store.model; @@ -98,10 +104,9 @@ _.each(["_mount", "populate"], function (name) { var old = BI.Widget.prototype[name]; old && (BI.Widget.prototype[name] = function () { - var store = findStore(this); - store && pushTarget(store); + this.store && pushTarget(this.store); var res = old.apply(this, arguments); - store && popTarget(); + this.store && popTarget(); return res; }); });