Skip to content

Commit 591be56

Browse files
committed
chore: change isChangingPage and legacy router registration
1 parent b53dfc9 commit 591be56

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

packages/router/src/router.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,14 +1302,12 @@ export function createRouter(
13021302
return
13031303
}
13041304

1305-
this.isReady().then(() => {
1306-
;[
1307-
beforeResolveTransitionGuard,
1308-
afterEachTransitionGuard,
1309-
onErrorTransitionGuard,
1310-
popStateListener,
1311-
] = enableViewTransition(this, options)
1312-
})
1305+
;[
1306+
beforeResolveTransitionGuard,
1307+
afterEachTransitionGuard,
1308+
onErrorTransitionGuard,
1309+
popStateListener,
1310+
] = enableViewTransition(this, options)
13131311
},
13141312

13151313
install(app: App) {

packages/router/src/utils/routes.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { RouteLocationNormalized } from '../typed-routes'
2-
import { START_LOCATION } from '../index'
2+
import { START_LOCATION_NORMALIZED } from '../location'
33

44
// from Nuxt
55
const ROUTE_KEY_PARENTHESES_RE = /(:\w+)\([^)]+\)/g
@@ -24,7 +24,11 @@ export function isChangingPage(
2424
to: RouteLocationNormalized,
2525
from: RouteLocationNormalized
2626
) {
27-
if (to === from || from === START_LOCATION) {
27+
if (
28+
to === START_LOCATION_NORMALIZED ||
29+
to === from ||
30+
from === START_LOCATION_NORMALIZED
31+
) {
2832
return false
2933
}
3034

0 commit comments

Comments
 (0)