vue router name with params code example
Example 1: get params from route vuejs
const User = {
template: '<div>User {{ $route.params.id }}</div>'
}
Example 2: vue router name
<router-link :to="{ name: 'user', params: { userId: 123 }}">User</router-link>
Example 3: vuejs router params
<router-link :to="{ name: 'movie', params: { id: item.id } }">{{ item.title }}</router-link>
Example 4: vue router name
router.push({ name: 'user', params: { userId: 123 }})