From 91a795f55f3f8139dd608e29cb408eb8020bda81 Mon Sep 17 00:00:00 2001 From: zsmj Date: Sat, 22 Oct 2022 13:22:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=20=E6=B7=BB=E5=8A=A0BI.execWithCo?= =?UTF-8?q?ntext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/4.widget.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index bca87b9fc..8be3a9058 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) {