From 58a486c8ffea280708d8ff7e884808ecf135b2a9 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 11 Jun 2020 11:40:14 +0800 Subject: [PATCH] bugfix --- src/core/inject.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/inject.js b/src/core/inject.js index 44fb9dfa1..2e779a619 100644 --- a/src/core/inject.js +++ b/src/core/inject.js @@ -57,7 +57,10 @@ if (!providers[type]) { providers[type] = new providerInjection[type](); } - providerInstance[type] = null; + // 如果config被重新配置的话,需要删除掉之前的实例 + if (providerInstance[type]) { + delete providerInstance[type]; + } return configFn(providers[type]); } return BI.Plugin.configWidget(type, configFn); @@ -75,7 +78,9 @@ if (!providers[type]) { providers[type] = new providerInjection[type](); } - providerInstance[type] = null; + if (providerInstance[type]) { + delete providerInstance[type]; + } queue[i](providers[type]); continue; }