mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(nuxt3): initialize router with normalized url (#4427)
This commit is contained in:
parent
7a316c289a
commit
90da56a03b
@ -82,7 +82,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Allows suspending the route object until page navigation completes
|
// Allows suspending the route object until page navigation completes
|
||||||
const path = process.server ? nuxtApp.ssrContext.req.url : createCurrentLocation(baseURL, window.location)
|
const path = process.server ? nuxtApp.ssrContext.url : createCurrentLocation(baseURL, window.location)
|
||||||
const _activeRoute = shallowRef(router.resolve(path) as RouteLocation)
|
const _activeRoute = shallowRef(router.resolve(path) as RouteLocation)
|
||||||
const syncCurrentRoute = () => { _activeRoute.value = router.currentRoute.value }
|
const syncCurrentRoute = () => { _activeRoute.value = router.currentRoute.value }
|
||||||
nuxtApp.hook('page:finish', syncCurrentRoute)
|
nuxtApp.hook('page:finish', syncCurrentRoute)
|
||||||
|
Loading…
Reference in New Issue
Block a user