Methods a

this.$router.push({
    path:`/home/${id}}) Route configuration {path:"/home/:id",
    name:"Home", Component :Home} Gets the parameter value this in the Home component.$route.params.id
Copy the code

Method 2

The route is matched by name and the parameter this is passed by param.$router.push({
    name:'Home', params:{id:id}}) pass parameters with params, do not use: /id {path:'/home', name:Home, Component :Home} Get this from the Home component.$route.params.id
Copy the code

Methods three

path+query; Will the parameters passed by query pass? Id = XXX Display

this.$router.push({
    path:'/home', query:{id:id}}) Route configuration {path:'/home', name:Home, component:Home} Method to get arguments this.$route.query.id
Copy the code