ui: external module support

This commit is contained in:
undefined committed 2022-01-09 05:03:21 +08:00
1 parent f020923d35
commit 86ead663df
8 files changed
+29 -11

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
export default async function loadExternalModule(target: string) {
const ele = document.createElement('script');
ele.src = target;
await new Promise((resolve, reject) => {
ele.onload = resolve;
ele.onerror = reject;
document.head.appendChild(ele);
});
return window.exports;
}