Vue-router: Setting params from v-link isn't working

Created on 23 Sep 2015  路  5Comments  路  Source: vuejs/vue-router

I'm trying to put parameters with v-link as described here:

<!-- named route -->
<a v-link="{ name: 'user', params: { userId: 123 }}">User</a>

But it not works correctly. See fiddle: http://jsfiddle.net/bz3vdcze/1/

Most helpful comment

You are using path instead of name in your v-link.

All 5 comments

Missing route name and param key inside route definition.

See my fork: http://jsfiddle.net/j00ox1zt/

You are using path instead of name in your v-link.

Ah, thanks! It was unclear. It looks like object, why need I specify name? Can't find it in docs.

Thanks Evan.

Was this page helpful?
0 / 5 - 0 ratings