From 0cb402040f80a6af38c85dc0e6b2de1bcab2b913 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 11 Oct 2020 23:20:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?context=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/fix/fix.compact.ie.js | 6 ++++-- dist/fix/fix.compact.js | 6 ++++-- src/core/widget.js | 12 ++++++++---- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/dist/fix/fix.compact.ie.js b/dist/fix/fix.compact.ie.js index 09ac4f861..e032d1a8f 100644 --- a/dist/fix/fix.compact.ie.js +++ b/dist/fix/fix.compact.ie.js @@ -33,8 +33,10 @@ } function popTarget () { - targetStack.pop(); - Fix.Model.target = target = null; + Fix.Model.target = target = targetStack.pop(); + if (targetStack.length <= 0) { + BI.Widget.target = target = null; + } } var oldWatch = Fix.watch; diff --git a/dist/fix/fix.compact.js b/dist/fix/fix.compact.js index 7e6e5f3ca..8228dfba9 100644 --- a/dist/fix/fix.compact.js +++ b/dist/fix/fix.compact.js @@ -33,8 +33,10 @@ } function popTarget () { - targetStack.pop(); - Fix.Model.target = target = null; + Fix.Model.target = target = targetStack.pop(); + if (targetStack.length <= 0) { + BI.Widget.target = target = null; + } } var oldWatch = Fix.watch; diff --git a/src/core/widget.js b/src/core/widget.js index 73657f86c..90ff22ee6 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -517,8 +517,10 @@ }; BI.Widget.popContext = function () { - contextStack.pop(); - BI.Widget.context = context = null; + BI.Widget.context = context = contextStack.pop(); + if (contextStack.length <= 0) { + BI.Widget.context = context = null; + } }; function pushTarget (_current) { @@ -527,8 +529,10 @@ } function popTarget () { - currentStack.pop(); - BI.Widget.current = current = null; + BI.Widget.current = current = currentStack.pop(); + if (currentStack.length <= 0) { + BI.Widget.current = current = null; + } } BI.onBeforeMount = function (beforeMount) { From 9ba0f3f17ee9e4a5db28a457ecbba6a668016a6a Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 11 Oct 2020 23:21:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?context=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/fix/fix.compact.ie.js | 2 +- dist/fix/fix.compact.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/fix/fix.compact.ie.js b/dist/fix/fix.compact.ie.js index e032d1a8f..9e9901f88 100644 --- a/dist/fix/fix.compact.ie.js +++ b/dist/fix/fix.compact.ie.js @@ -35,7 +35,7 @@ function popTarget () { Fix.Model.target = target = targetStack.pop(); if (targetStack.length <= 0) { - BI.Widget.target = target = null; + Fix.Model.target = target = null; } } diff --git a/dist/fix/fix.compact.js b/dist/fix/fix.compact.js index 8228dfba9..92c08f42b 100644 --- a/dist/fix/fix.compact.js +++ b/dist/fix/fix.compact.js @@ -35,7 +35,7 @@ function popTarget () { Fix.Model.target = target = targetStack.pop(); if (targetStack.length <= 0) { - BI.Widget.target = target = null; + Fix.Model.target = target = null; } }