vue获取url中变量路由
定义:
const router = new VueRouter({
routes: [
{
path: '/user/:id',
component: user
},
]
})
使用:
this.$route.params.id
定义:
const router = new VueRouter({
routes: [
{
path: '/user/:id',
component: user
},
]
})
使用:
this.$route.params.id