From fbfeaa5021193b56d2efd3cd7353974f71c23518 Mon Sep 17 00:00:00 2001 From: dailer Date: Tue, 30 Jul 2019 19:21:21 +0800 Subject: [PATCH] =?UTF-8?q?DEC-8536=20=20fix=20:=20=E4=BF=AE=E5=A4=8D=20?= =?UTF-8?q?=5Fmount=E6=89=A7=E8=A1=8C=E4=B8=AD=E6=96=AD=E5=AF=BC=E8=87=B4c?= =?UTF-8?q?ontext=E6=8C=87=E5=90=91=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/fix/fix.compact.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/dist/fix/fix.compact.js b/dist/fix/fix.compact.js index fcacac857..17e89a2de 100644 --- a/dist/fix/fix.compact.js +++ b/dist/fix/fix.compact.js @@ -1,5 +1,5 @@ ;(function () { - function initWatch(vm, watch) { + function initWatch (vm, watch) { vm._watchers || (vm._watchers = []); for (var key in watch) { var handler = watch[key]; @@ -13,7 +13,7 @@ } } - function createWatcher(vm, keyOrFn, handler) { + function createWatcher (vm, keyOrFn, handler) { return Fix.watch(vm.model, keyOrFn, _.bind(handler, vm), { store: vm.store }); @@ -22,24 +22,24 @@ var target = null; var targetStack = []; - function pushTarget(_target) { + function pushTarget (_target) { if (target) targetStack.push(target); Fix.Model.target = target = _target; } - function popTarget() { + function popTarget () { Fix.Model.target = target = targetStack.pop(); } var context = null; var contextStack = []; - function pushContext(_context) { + function pushContext (_context) { if (context) contextStack.push(context); Fix.Model.context = context = _context; } - function popContext() { + function popContext () { Fix.Model.context = context = contextStack.pop(); } @@ -60,7 +60,7 @@ }, options); }; - function findStore(widget) { + function findStore (widget) { if (target != null) { return target; } @@ -106,7 +106,7 @@ }; }); - function createStore() { + function createStore () { var needPop = false; if (_global.Fix && this._store) { var store = findStore(this.options.context || this.options.element); @@ -172,7 +172,11 @@ var old = BI.Widget.prototype[name]; old && (BI.Widget.prototype[name] = function () { this.store && pushTarget(this.store); - var res = old.apply(this, arguments); + try { + var res = old.apply(this, arguments); + } catch (e) { + console.error(e); + } this.store && popTarget(); return res; }); @@ -246,4 +250,4 @@ }; } BI.watch = Fix.watch; -}()); \ No newline at end of file +}());