diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 44617d076..1873e0b44 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -927,6 +927,16 @@ return vm; }; + BI.execWithContext = function (_context, fn) { + BI.Widget.pushContext(_context); + try { + fn(); + } catch (e) { + // nothing + } + BI.Widget.popContext(); + }; + BI.watch = function (vm, watch, handler) { // 必须要保证组件当前环境存在 if (BI.Widget.current) {