1.第一步,在你要跳转的字段列表里加一个按钮,然后为其添加一个点击按钮
<el-table-column label="瓦斯分带" prop="gasZoning" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="jumpPage(scope.row)"
><span>{{ scope.row.gasZoning }}</span></el-button>
</template>
</el-table-column>
2.在methods:{}方法里写上一个方法jumpPage,将你要传到另一个页面的参数写上
jumpPage(row){
this.$router.push({
name: "Totalinfo",
params : {
mineFloorNo : row.mineFloorNo,
}
})
},
3.在你要跳转的页面添加监听器,监听数值变化
watch: {
$route:{
handler(newVal,oldVal){
if(newVal.params.mineFloorNo){
this.queryParams.mineFloorNo= newVal.params.mineFloorNo;
this.getList(this.queryParams);
}
},
deep:true,
immediate:true
}
},