From d890faa318f654ca1ec737e8506acbe38178ec3f Mon Sep 17 00:00:00 2001 From: star sky <1176789241@qq.com> Date: Fri, 15 Oct 2021 00:09:56 +0800 Subject: [PATCH] fix: navigate to 404, the page will be blank --- src/client/app/router.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index e7f1c59a..4755f2ed 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -20,13 +20,22 @@ export const RouterSymbol: InjectionKey = Symbol() // matter and is only passed to support same-host hrefs. const fakeHost = `http://a.com` +const getDefaultPageData = (): PageData => ({ + relativePath: '', + title: '', + description: '', + headers: [], + frontmatter: {}, + lastUpdated: 0 +}) + const getDefaultRoute = (): Route => ({ path: '/', component: null, // this will be set upon initial page load, which is before // the app is mounted, so it's guaranteed to be available in // components - data: null as any + data: getDefaultPageData() }) interface PageModule {