From 216e12950b312f9f5b8af74cac0ce243693e37ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Fri, 6 May 2022 08:59:13 +0200 Subject: [PATCH] fix: remove 404 from title on initial route (#590) fix #589 --- src/client/app/index.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/client/app/index.ts b/src/client/app/index.ts index 3065c81365a..ea5fe60c6b9 100644 --- a/src/client/app/index.ts +++ b/src/client/app/index.ts @@ -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) @@ -85,7 +80,7 @@ export function createApp() { }) } - return { app, router } + return { app, router, data } } function newApp(): App { @@ -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') }) }