N
Nuxt6mo ago
zk1;*

How can I pass more props in a nuxtlink or in a router in nuxt 3

I need help... I would like to know how can I pass parameters like it was done in Vue 2 when you passed parameters as props... thanks in advance
5 Replies
zk1;*
zk1;*OP6mo ago
@ÁngelHdz🔥☕⏰
Cake
Cake6mo ago
Not sure what you're asking.
zk1;*
zk1;*OP6mo ago
I want to pass parameters with nuxtlink
Smef
Smef6mo ago
You can pass query parameters with a link and then read them in your component when the component is being loaded. A link won't directly interact with a component
useRoute().query
useRoute().query
localhostess
localhostess6mo ago
I think he means you used to be able to do this, and now you can't
<nuxt-link :to="{ name: 'user', params: { userId: 123 }}">User</nuxt-link>
<nuxt-link :to="{ name: 'user', params: { userId: 123 }}">User</nuxt-link>
You don't always want query params added to the url
Want results from more Discord servers?
Add your server