Skip to content

Commit

Permalink
* zin: fix multiple js not work in $.getLib.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Mar 28, 2024
1 parent 35ca5f5 commit 1a7abf8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/core/src/dom/get-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ $.getLib = async function<T = unknown> (optionsOrSrc: string | string[] | GetLib
}

const {root = $.libRoot} = options;
await Promise.all(srcList.map(srcOptions => {
for (let srcOptions of srcList) {
if (typeof srcOptions === 'string') {
srcOptions = {src: srcOptions};
}
Expand All @@ -210,10 +210,11 @@ $.getLib = async function<T = unknown> (optionsOrSrc: string | string[] | GetLib
src,
};
if (srcOptions.type === 'css' || (!srcOptions.type && src.endsWith('.css'))) {
return loadCSS(loadOptions as LoadCSSOptions);
await loadCSS(loadOptions as LoadCSSOptions);
return;
}
return loadJS(loadOptions as LoadJSOptions);
}));
await loadJS(loadOptions as LoadJSOptions);
}
return onSuccess();
};

Expand Down

0 comments on commit 1a7abf8

Please sign in to comment.