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
//routes.js
{
name:"routeName",
path: "/RourteUrl/:id",
...
//when creating a route make sure you add a name:"route name" to your declaration
//other wise you cant use router.push({name:"route name",params:{}})
//the name must be identified in routes.js to let vue router use the name and
//build the url
//in your code
router.push({ name: 'routeName', params: { id: 'your id' } })