Reputation: 1839
I cannot figure out the correct syntax for passing dynamic param data. I have tried a couple of variations, but I would assume I could inject someValue via:
<router-link :to="{ name: 'Foo', params:{ bar: ${someValue} } }">
However, I keep getting compiler errors.
Upvotes: 1
Views: 152
Reputation: 1
You could pass any dynamic property via router-link
params like :
<router-link :to="{ name: 'Foo', params:{ bar:someValue} }">
someValue
sould be a data object item or computed property, and if you want to pass a value returned with a method you could do it like :
<router-link :to="{ name: 'Foo', params:{ bar:someMethod()} }">
Upvotes: 2