vue dynamic route push with params 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 dynamic route push with params
const userId = '123'
router.push({ name: 'user', params: { userId } })
router.push({ path: `/user/${userId}` })
router.push({ path: '/user', params: { userId } })