File tree 2 files changed +13
-11
lines changed
2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -121,25 +121,28 @@ function newRouter(): Router {
121
121
122
122
return createRouter ( ( path ) => {
123
123
let pageFilePath = pathToFile ( path )
124
+ let pageModule = null
124
125
125
- if ( ! pageFilePath ) return null
126
+ if ( pageFilePath ) {
127
+ if ( isInitialPageLoad ) {
128
+ initialPath = pageFilePath
129
+ }
126
130
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
+ }
130
137
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 )
136
139
}
137
140
138
141
if ( inBrowser ) {
139
142
isInitialPageLoad = false
140
143
}
141
144
142
- return import ( /* @vite -ignore*/ pageFilePath )
145
+ return pageModule
143
146
} , Theme . NotFound )
144
147
}
145
148
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ onMounted(() => {
37
37
class =" link"
38
38
:href =" withBase(root)"
39
39
:aria-label =" theme.notFound?.linkLabel ?? 'go to home'"
40
- target =" _self"
41
40
>
42
41
{{ theme.notFound?.linkText ?? 'Take me home' }}
43
42
</a >
You can’t perform that action at this time.
0 commit comments