Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 4, 2022
1 parent 74a0308 commit 28cd607
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/nuxt/src/pages/runtime/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ const Component = defineComponent({
props: ['routeProps', 'pageKey'],
setup (props) {
// Prevent reactivity when the page will be rerendered in a different suspense fork
const firstKey = props.pageKey
const firstRoute = props.routeProps.route
const previousKey = props.pageKey
const previousRoute = props.routeProps.route

// Provide a reactive route within the page
const route = {}
for (const key in props.routeProps.route) {
route[key] = computed(() => firstKey === props.pageKey ? props.routeProps.route[key] : firstRoute[key])
route[key] = computed(() => previousKey === props.pageKey ? props.routeProps.route[key] : previousRoute[key])
}

provide('_route', reactive(route))
Expand Down

0 comments on commit 28cd607

Please sign in to comment.