i'am trying to passing param to nuxt-link (router-link vue) but it seems doesnt work. this is my snippet and folder structure
<nuxt-link :to="{path: '/post-detail', params: { id:idPost } }">
{{title}}
</nuxt-link>
when i try to hovering on the link, it seems the params is missing
did i forgot something...
sory for bad english
If you want to use params
you need to use name
and not path
:
<nuxt-link :to="{name: 'post-detail-id', params: { id:idPost } }">{{title}}</nuxt-link>
You can see the name for each route into .nuxt/router.js
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
If you want to use
params
you need to usename
and notpath
:You can see the name for each route into
.nuxt/router.js