Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vue dynamic route push with params

const userId = '123'
router.push({ name: 'user', params: { userId } }) // -> /user/123
router.push({ path: `/user/${userId}` }) // -> /user/123
// This will NOT work
router.push({ path: '/user', params: { userId } }) // -> /user
Source by router.vuejs.org #
 
PREVIOUS NEXT
Tagged: #vue #dynamic #route #push #params
ADD COMMENT
Topic
Name
4+5 =