add day 13, SSRgit checkout maingit checkout mainsudo pacman -S virt-manager qemu vde2 ebtables dnsmasq bridge-utils openbsd-netcat
checkout
This commit is contained in:
18
day13/src/entry-client.js
Normal file
18
day13/src/entry-client.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import { renderPage, hydratePage } from './lib/router';
|
||||
import { isSSR, appState } from '/src/main';
|
||||
|
||||
export async function mount(mounted) {
|
||||
eval(mounted)
|
||||
}
|
||||
|
||||
if (!import.meta.env.SSR) {
|
||||
// waits for the page to fully load to render the page from the virtDOM
|
||||
if (!isSSR) {
|
||||
await renderPage()
|
||||
window.onpopstate = async () => {
|
||||
await renderPage()
|
||||
}
|
||||
} else {
|
||||
hydratePage()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user