From 613f6d2ddcd3a83c11e6c88de5020f2558a9fd5c Mon Sep 17 00:00:00 2001 From: cloudstone Date: Wed, 30 Sep 2020 00:28:41 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=20use=20lodash=20forEach=20inst?= =?UTF-8?q?ead=20to=20traverse=20NodeList=20for=20compatible=20reason=20(#?= =?UTF-8?q?965)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 陈师东 --- src/loader.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/loader.ts b/src/loader.ts index f7a8a67..044ca5b 100644 --- a/src/loader.ts +++ b/src/loader.ts @@ -4,7 +4,7 @@ */ import { importEntry } from 'import-html-entry'; -import { concat, mergeWith } from 'lodash'; +import { concat, mergeWith, forEach } from 'lodash'; import { LifeCycles, ParcelConfigObject } from 'single-spa'; import getAddOns from './addons'; import { getMicroAppStateActions } from './globalState'; @@ -249,7 +249,7 @@ export async function loadApp( let element: HTMLElement | null = createElement(appContent, strictStyleIsolation); if (element && isEnableScopedCSS(configuration)) { const styleNodes = element.querySelectorAll('style') || []; - styleNodes.forEach(stylesheetElement => { + forEach(styleNodes, (stylesheetElement: HTMLStyleElement) => { css.process(element!, stylesheetElement, appName); }); }