query
//传递参数
this.$router.push({
path: '/zh',
query: {
id: id,
shopid:shop_id
}
});
//接受参数
this.$route.query.参数
//路由
{
path: '/zh',
name: 'Zh',
component: () => import('')
},
params
this.$router.push({ name: '/shop', params: { id: '1' } })
//接收
this.$route.params.id
//配置路由
{
path: '/shop/:id',
name: 'Shop',
component: () => import('')
},