update deps + eslint + element as second arg on mount

This commit is contained in:
2023-02-23 16:45:07 +03:00
parent d94d9e03cf
commit c7ddae4b86
12 changed files with 10089 additions and 327 deletions
+10 -2
View File
@@ -1,3 +1,4 @@
/* eslint-disable prefer-const */
import "systemjs/dist/system";
import "systemjs/dist/extras/amd";
import "systemjs/dist/extras/named-register";
@@ -16,6 +17,13 @@ const systemJSImport = async (requestUrl: string) => {
return { component, mount, unmount }
}
let mainMountElement = document.getElementById('app');
if (!mainMountElement) {
mainMountElement = document.createElement('div');
mainMountElement.id = 'app';
}
export default async ({ apps: rawApps, navigations, config, features }) => {
defineVirtualModule({ navigations, config, features })
@@ -38,7 +46,7 @@ export default async ({ apps: rawApps, navigations, config, features }) => {
}
let { component, mount, unmount } = await getApp()
mount(component.default);
mount(component.default, mainMountElement);
history.listen(async (location) => {
if (location.pathname !== prevPathname) {
@@ -46,7 +54,7 @@ export default async ({ apps: rawApps, navigations, config, features }) => {
unmount()
const nextApp = await getApp();
nextApp.mount(nextApp.component.default)
nextApp.mount(nextApp.component.default, mainMountElement)
unmount = nextApp.unmount;
}
})