1// literal string path
2router.push('/users/eduardo')
3
4// object with path
5router.push({ path: '/users/eduardo' })
6
7// named route with params to let the router build the url
8router.push({ name: 'user', params: { username: 'eduardo' } })
9
10// with query, resulting in /register?plan=private
11router.push({ path: '/register', query: { plan: 'private' } })
12
13// with hash, resulting in /about#team
14router.push({ path: '/about', hash: '#team' })
15
1const userId = '123'
2router.push({ name: 'user', params: { userId } }) // -> /user/123
3router.push({ path: `/user/${userId}` }) // -> /user/123
4// This will NOT work
5router.push({ path: '/user', params: { userId } }) // -> /user