//当触发一个按钮,发生跳转
applyDetail(index) {
//路由跳转
this.$router.push({
path: "/huaxiainsuranceApplyDetail",//目标地址,vue的跳转需要单独的配置
query: {
//跳转携带的参数信息
userId: this.insuranceList[index].userId,
id: this.insuranceList[index].id,
applyNo: this.insuranceList[index].applyNo,
status: this.insuranceList[index].status
}
});
},
//配置,路由
核心代码:
this.$router.push({
path: "路径地址",//目标地址,
query: {
id: this.insuranceList[index].id,//参数名:参数
}
});
注意:
1.路径地址,要在你的项目中,事先配置好。要不然识别不了。
2.参数,路径跳转的时候,会将你的参数携带在地址连接上。到下一个页面可以直接使用
在跳转的页面接收你携带过来的数据——id: this.$route.query.id,
结束~