mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 09:02:03 +00:00
Merge 52a344d57d
into edc299a043
This commit is contained in:
commit
57704665e1
@ -1,4 +1,4 @@
|
|||||||
import { isReadonly, reactive, shallowReactive, shallowRef } from 'vue'
|
import { isReadonly, reactive, shallowReactive, shallowRef, toValue } from 'vue'
|
||||||
import type { Ref } from 'vue'
|
import type { Ref } from 'vue'
|
||||||
import type { RouteLocation, RouteLocationNormalizedLoaded, Router, RouterScrollBehavior } from 'vue-router'
|
import type { RouteLocation, RouteLocationNormalizedLoaded, Router, RouterScrollBehavior } from 'vue-router'
|
||||||
import { START_LOCATION, createMemoryHistory, createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
|
import { START_LOCATION, createMemoryHistory, createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
|
||||||
@ -114,6 +114,9 @@ const plugin: Plugin<{ router: Router }> = defineNuxtPlugin({
|
|||||||
// so we need to update the route manually
|
// so we need to update the route manually
|
||||||
if (to.matched[0]?.components?.default === from.matched[0]?.components?.default) {
|
if (to.matched[0]?.components?.default === from.matched[0]?.components?.default) {
|
||||||
syncCurrentRoute()
|
syncCurrentRoute()
|
||||||
|
} else {
|
||||||
|
// assign toValue to avoid reactivity
|
||||||
|
Object.assign(toValue(_route), router.currentRoute.value)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user