diff --git a/package.json b/package.json index b468a5c37..20d118ed6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221022172437", + "version": "2.0.20221022202435", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", diff --git a/src/core/4.widget.js b/src/core/4.widget.js index f9e27d296..ab85900ff 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) {