push route with params vue code example
Example 1: vue router.push with params
router.push('/users/eduardo')
router.push({ path: '/users/eduardo' })
router.push({ name: 'user', params: { username: 'eduardo' } })
router.push({ path: '/register', query: { plan: 'private' } })
router.push({ path: '/about', hash: '#team' })
Example 2: vue router name
<router-link :to="{ name: 'user', params: { userId: 123 }}">User</router-link>
Example 3: vue router name
router.push({ name: 'user', params: { userId: 123 }})