change route name dynamic vue code example
Example 1: vue router link dynamic id
<div class="category-list" v-for="category in categories">
<router-link :to="{ name: 'category/edit', params: { categoryId: category.id }}">Home</router-link>
</div>
Example 2: get params from route vuejs
const User = {
template: '<div>User {{ $route.params.id }}</div>'
}