File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -121,25 +121,28 @@ function newRouter(): Router {
121121
122122 return createRouter ( ( path ) => {
123123 let pageFilePath = pathToFile ( path )
124+ let pageModule = null
124125
125- if ( ! pageFilePath ) return null
126+ if ( pageFilePath ) {
127+ if ( isInitialPageLoad ) {
128+ initialPath = pageFilePath
129+ }
126130
127- if ( isInitialPageLoad ) {
128- initialPath = pageFilePath
129- }
131+ // use lean build if this is the initial page load or navigating back
132+ // to the initial loaded path (the static vnodes already adopted the
133+ // static content on that load so no need to re-fetch the page)
134+ if ( isInitialPageLoad || initialPath === pageFilePath ) {
135+ pageFilePath = pageFilePath . replace ( / \. j s $ / , '.lean.js' )
136+ }
130137
131- // use lean build if this is the initial page load or navigating back
132- // to the initial loaded path (the static vnodes already adopted the
133- // static content on that load so no need to re-fetch the page)
134- if ( isInitialPageLoad || initialPath === pageFilePath ) {
135- pageFilePath = pageFilePath . replace ( / \. j s $ / , '.lean.js' )
138+ pageModule = import ( /*@vite -ignore*/ pageFilePath )
136139 }
137140
138141 if ( inBrowser ) {
139142 isInitialPageLoad = false
140143 }
141144
142- return import ( /* @vite -ignore*/ pageFilePath )
145+ return pageModule
143146 } , Theme . NotFound )
144147}
145148
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ onMounted(() => {
3737 class =" link"
3838 :href =" withBase(root)"
3939 :aria-label =" theme.notFound?.linkLabel ?? 'go to home'"
40- target =" _self"
4140 >
4241 {{ theme.notFound?.linkText ?? 'Take me home' }}
4342 </a >
You can’t perform that action at this time.
0 commit comments