Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove 404 from title on initial route #590

Merged
merged 1 commit into from May 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/client/app/index.ts
Expand Up @@ -55,11 +55,6 @@ export function createApp() {
const data = initData(router.route)
app.provide(dataSymbol, data)

if (inBrowser) {
// dynamically update head tags
useUpdateHead(router.route, data.site)
}

// install global components
app.component('Content', Content)
app.component('ClientOnly', ClientOnly)
Expand All @@ -85,7 +80,7 @@ export function createApp() {
})
}

return { app, router }
return { app, router, data }
}

function newApp(): App {
Expand Down Expand Up @@ -145,10 +140,12 @@ function shouldHotReload(payload: any): boolean {
}

if (inBrowser) {
const { app, router } = createApp()
const { app, router, data } = createApp()

// wait until page component is fetched before mounting
router.go().then(() => {
// dynamically update head tags
useUpdateHead(router.route, data.site)
app.mount('#app')
})
}