A页面:
a标签是这样滴
<a @click="xiangmu(record)" ">申请列表</a>
写在methods中的方法
xiangmu(record){
var url = "/success/basicdataverification/BasicDataVerificationList";
this.$router.push({
path:url,
query:{
ti:record.id,
}
})
},
b页面来接受的方法
loadData(){
let ti = this.$route.query.ti;
getAction(this.url.list, {pid: ti, pageNo : this.ipagination.current,
pageSize :this.ipagination.pageSize}).then((res) => {
if (res.success) {
this.dataSource = res.result.records;
this.ipagination.total = res.result.total;
} else {
this.dataSource = null;
}
})
},
this.url.list是定义在data中的
url: {
list: "/basicdataverification/basicDataVerification/list",
delete: "/basicdataverification/basicDataVerification/delete",
deleteBatch: "/basicdataverification/basicDataVerification/deleteBatch",
exportXlsUrl: "basicdataverification/basicDataVerification/exportXls",
importExcelUrl: "basicdataverification/basicDataVerification/importExcel",
},
pid是b表的外键,以此作为筛选条件列出列表
当然,b页面也可以直接获取到这个参数,是这样滴
this.$route.query.id