首先在点击跳转的地方传值
on: {
click: () => {
this.$router.push({path:`./detail`,query:{detailId: params.row.detailId,
phone:this.checkData.phone,name:this.checkData.name}})
}
}
在详情内调用外面列表的接口,将传过来的值赋给接口利用filter来获取id,(表达太麻烦了,代码奉上)
methods:{
initData(){
ApiClient.get('/backend/customerDetail/list.do',{page:1,size:9999999,state:'处理中',phone:this.$route.query.phone,name:this.$route.query.name}).then(data => {
const self = this;
this.dataGroup = data.items;
const filterData = data.items.filter(function(v,i){
if(v.detailId == self.$route.query.detailId){
self.index = i;
return v
}
});
this.data = filterD