From ebd6365511d5ae44ecfd6841c9957c5f621068fa Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 21 Jun 2022 15:21:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=20=E7=BB=99BI.config=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=8F=AF=E4=BB=A5=E7=AB=8B=E5=8D=B3?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E9=85=8D=E7=BD=AE=E5=87=BD=E6=95=B0=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 详见 https://kms.fineres.com/x/043LGQ --- src/core/5.inject.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/core/5.inject.js b/src/core/5.inject.js index 3cb1d15bf..2bc662e18 100644 --- a/src/core/5.inject.js +++ b/src/core/5.inject.js @@ -92,12 +92,23 @@ }; var configFunctions = BI.OB.configFunctions = {}; - var runConfigFunction = function (type) { + var runConfigFunction = function (type, configFn) { if (!type || !configFunctions[type]) { return false; } - var queue = configFunctions[type]; - delete configFunctions[type]; + + var queue = []; + if (configFn) { + queue = configFunctions[type].filter(function (conf) { + return conf.fn === configFn; + }); + configFunctions[type] = configFunctions[type].filter(function (conf) { + return conf.fn !== configFn; + }); + } else { + queue = configFunctions[type]; + delete configFunctions[type]; + } var dependencies = BI.Providers.getProvider("bi.provider.system").getDependencies(); var modules = moduleInjectionMap.components[type] @@ -176,6 +187,10 @@ fn: configFn, opt: opt }); + + if (opt.immediately) { + return runConfigFunction(type, configFn); + } }; BI.getReference = BI.getReference || function (type, fn) {