Skip to content

Commit

Permalink
Keep props object linked to page to be able to destructure them with …
Browse files Browse the repository at this point in the history
…toRefs.
  • Loading branch information
mathieutu committed Feb 27, 2023
1 parent 1b086ee commit 07592ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vue3/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ const App: InertiaApp = defineComponent({
resolveComponent,
swapComponent: async (args: VuePageHandlerArgs) => {
component.value = markRaw(args.component)
Object.assign(page, args.page)
const { props, ...rest } = args.page

Object.assign(page, rest)
Object.assign(page.props, props)

key.value = args.preserveState ? key.value : Date.now()
},
})
Expand Down

0 comments on commit 07592ee

Please sign in to comment.