File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,19 @@ export const RouterSymbol: InjectionKey<Router> = Symbol()
2121// matter and is only passed to support same-host hrefs.
2222const fakeHost = `http://a.com`
2323
24+ const notFoundPageData : PageData = {
25+ relativePath : '' ,
26+ title : '404' ,
27+ description : 'Not Found' ,
28+ headers : [ ] ,
29+ frontmatter : { } ,
30+ lastUpdated : 0
31+ }
32+
2433const getDefaultRoute = ( ) : Route => ( {
2534 path : '/' ,
2635 component : null ,
27- // this will be set upon initial page load, which is before
28- // the app is mounted, so it's guaranteed to be available in
29- // components. We just need enough data for 404 pages to render.
30- data : { frontmatter : { } } as any
36+ data : notFoundPageData
3137} )
3238
3339interface PageModule {
@@ -123,15 +129,7 @@ export function createRouter(
123129 latestPendingPath = null
124130 route . path = pendingPath
125131 route . component = fallbackComponent ? markRaw ( fallbackComponent ) : null
126- // reset page data
127- route . data = {
128- relativePath : '' ,
129- title : '404' ,
130- description : 'Not Found' ,
131- headers : [ ] ,
132- frontmatter : { } ,
133- lastUpdated : 0
134- }
132+ route . data = notFoundPageData
135133 }
136134 }
137135 }
You can’t perform that action at this time.
0 commit comments