mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(nuxt): ensure injected route
has enumerable keys (#28841)
This commit is contained in:
parent
30892da6ca
commit
b0bf8b55fc
@ -27,6 +27,7 @@ export const RouteProvider = defineComponent({
|
|||||||
for (const key in props.route) {
|
for (const key in props.route) {
|
||||||
Object.defineProperty(route, key, {
|
Object.defineProperty(route, key, {
|
||||||
get: () => previousKey === props.renderKey ? props.route[key as keyof RouteLocationNormalizedLoaded] : previousRoute[key as keyof RouteLocationNormalizedLoaded],
|
get: () => previousKey === props.renderKey ? props.route[key as keyof RouteLocationNormalizedLoaded] : previousRoute[key as keyof RouteLocationNormalizedLoaded],
|
||||||
|
enumerable: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,6 +122,7 @@ const plugin: Plugin<{ router: Router }> = defineNuxtPlugin({
|
|||||||
for (const key in _route.value) {
|
for (const key in _route.value) {
|
||||||
Object.defineProperty(route, key, {
|
Object.defineProperty(route, key, {
|
||||||
get: () => _route.value[key as keyof RouteLocation],
|
get: () => _route.value[key as keyof RouteLocation],
|
||||||
|
enumerable: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user