vite-plugin-pages
vite-plugin-pages copied to clipboard
Pass props to the route?
Description
Is there a way to pass props through router to the second page? Not params, not queries, but props?
https://router.vuejs.org/guide/essentials/passing-props.html#passing-props-to-route-components
Suggested solution
/
Alternative
No response
Additional context
No response
Validations
- [X] Follow the Code of Conduct
- [X] Read the docs.
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
I tried to implement a workaround but ran into a bug with extendRoute
https://github.com/hannoeru/vite-plugin-pages/issues/338
I wonder why you want to pass props and not params or anything else?
Either way, it seems that vue passes paramters as props but not documented very well. In the same link you sent you can see under Boolean mode that:
When props is set to true, the route.params will be set as the component props.
Which means you set props: true in the routes definition and then the params you pass to the route will be treated as props.