// 上一页
upPople() {
let _this = this;
let applyCode = this.$route.query.applyCode;
let paramList = sessionStorage.getItem("paramList");
let arrList = JSON.parse(paramList);
for (let i = 0; i < arrList.length; i++) {
if (applyCode == arrList[i].applyCode) {
this.popleList = arrList[i - 1];
let query = Object.assign({applyCode:arrList[i - 1].applyCode,candidateCode:arrList[i - 1].candidateCode}, {} )
this.$router.push({ query})
}
}
},
// 下一页
dwonPople(){
let _this = this;
let applyCode = this.$route.query.applyCode;
let paramList = sessionStorage.getItem("paramList");
let arrList = JSON.parse(paramList);
for (let i = 0; i < arrList.length; i++) {
if (applyCode == arrList[i].applyCode) {
this.popleList = arrList[i + 1];
let query = Object.assign({applyCode:arrList[i + 1].applyCode,candidateCode:arrList[i + 1].candidateCode}, {} )
this.$router.push({ query})
}
}
},
watch:{
'$route' (to, from) { //监听路由是否变化
if(to.query.applyCode!= from.query.applyCode){
this.getPowerAlllist();
this.getChangepople();
this.getAtsgetServer();
this.getinfo();
this.getinfourl();
this.getListResumeAtthachmentsRes();
this.getList();
this.getnote();
this.getselectTalentInfo();
this.getselectWritten();
this.getAtsSelectInterview();
}
}
},
let query = Object.assign({applyCode:arrList[i - 1].applyCode,candidateCode:arrList[i - 1].candidateCode}, {} )
this.$router.push({ query})
watch:{
'$route' (to, from) { //监听路由是否变化
if(to.query.applyCode!= from.query.applyCode){
}
}
},
更改当前路由的传参刷新页面
最新推荐文章于 2024-11-14 20:59:36 发布
本文探讨了在前后端开发中,如何有效利用路由变化来触发数据更新和状态管理,确保页面切换时数据的准确性和实时性。通过具体代码示例,详细解析了Vue.js中如何监听路由变化并调用相应的方法来获取和更新数据。
860

被折叠的 条评论
为什么被折叠?



