Theiaz
Theiaz
NNuxt
Created by Theiaz on 10/10/2024 in #❓・help
How to pass props to a page?
Okay, thanks for the explanation. As you mentioned, the coupling between the page and the router is already implicit, so an explicit coupling is no big deal. I'll link this answer in the stackoverflow question for future references.
9 replies
NNuxt
Created by Theiaz on 10/10/2024 in #❓・help
How to pass props to a page?
Well you could argue, that a page component will not be reused accross the application, however I thought if there is a better way (like in my Vue-only solution).
9 replies
NNuxt
Created by Theiaz on 10/10/2024 in #❓・help
How to pass props to a page?
Its described here in the first section: https://router.vuejs.org/guide/essentials/passing-props.html
Using $route or useRoute() in your component creates a tight coupling with the route which limits the flexibility of the component as it can only be used on certain URLs. While this is not necessarily a bad thing, we can decouple this behavior with a props option.
--> Thight coupling of router and component
9 replies