Nuxt.js: nuxt-link (vue router-link) param doesnt work

Created on 31 Aug 2017  路  2Comments  路  Source: nuxt/nuxt.js

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>

image

when i try to hovering on the link, it seems the params is missing
image

did i forgot something...
sory for bad english

This question is available on Nuxt.js community (#c1377)

Most helpful comment

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

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

msudgh picture msudgh  路  3Comments

lazycrazy picture lazycrazy  路  3Comments

uptownhr picture uptownhr  路  3Comments

surmon-china picture surmon-china  路  3Comments

nassimbenkirane picture nassimbenkirane  路  3Comments