From b513d358714a9f23a8f757fcebe31b079f38eb67 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 7 Dec 2021 19:38:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81BI.useContext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/4.widget.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 34d541285..f8fe45929 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -794,19 +794,16 @@ })); } } - if (vm._widget) { - vm._widget._watchers || (vm._widget._watchers = []); - vm._widget._watchers = vm._widget._watchers.concat(watchers); - } + // vm中一定有_widget + vm._widget._watchers || (vm._widget._watchers = []); + vm._widget._watchers = vm._widget._watchers.concat(watchers); return; } if (BI.Widget.current) { - handler = watch; watch = vm; BI.Widget.current.$watchDelayCallbacks || (BI.Widget.current.$watchDelayCallbacks = []); BI.Widget.current.$watchDelayCallbacks.push([watch, handler]); - } };