vue 路由传参
this.$router.push({
name: "roomDetails",
params: {
companyId: companyId,
id: id,
type: "Reserve"
}
});
router.js 里对应配置,否则刷新页面参数会消失
{
path: "/roomDetails/:companyId/:id/:type",
component: () => import("./views/life/roomDetails.vue"),
name: "roomDetails"
}
接受参数
this.$route.params.id