Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vue router push with params

//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' } })
Source by router.vuejs.org #
 
PREVIOUS NEXT
Tagged: #vue #router #push #params
ADD COMMENT
Topic
Name
8+4 =