Skip to content

Commit db39db0

Browse files
committed
chore: Update Vue example
1 parent 68f51c3 commit db39db0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

examples/vue/src/components/Header.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22
<header>
33
<nav>
4-
<RouterLink to="/" activeClass="active"> Home </RouterLink>
5-
<RouterLink to="/404" activeClass="active"> 404 </RouterLink>
4+
<RouterLink to="/" activeClass="active">Home</RouterLink>
5+
<RouterLink to="/404" activeClass="active">404</RouterLink>
66
</nav>
77
</header>
88
</template>

examples/vue/src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { createApp, createSSRApp } from 'vue';
21
// Vite can't seem to split a module w/ static & dynamic imports, so may as well statically import everything
2+
import { createApp, createSSRApp } from 'vue';
33
import { createWebHistory, createMemoryHistory, createRouter } from 'vue-router';
44

55
import App from './App.vue';
@@ -19,7 +19,9 @@ if (typeof window !== 'undefined') {
1919
});
2020

2121
const app = import.meta.env.DEV ? createApp(App) : createSSRApp(App);
22-
app.use(router).mount('#app');
22+
app.use(router);
23+
24+
router.isReady().then(() => app.mount('#app'));
2325
}
2426

2527
export async function prerender(data) {

0 commit comments

Comments
 (0)