当前位置:网站首页>If this.$router Push the same address with different parameters, and the page does not refresh
If this.$router Push the same address with different parameters, and the page does not refresh
2022-07-24 15:49:00 【Teln_ Xiao Kai】
background : If the default pages in the frame are cached , Use this.$router.push When you open a page with different parameters at the same address , Pages are also cached by default , The data will not be refreshed .
terms of settlement :
1、 Create a tag before opening the page
sessionStorage.setItem("cgsqmx","Refresh");2、 I found this mark when I left the page , Then delete the ruoyi cache
beforeRouteLeave (to, from, next) {
debugger;
if (to.name === 'Cgsqmx' && sessionStorage.getItem("cgsqmx")==="Refresh") {
try {
var cache = this.$vnode.parent.componentInstance.cache;
var key="";
for(var prop in cache){
if(prop.lastIndexOf("cgsqmx")>0){
key=prop;
}
}
if(key!=""){
delete cache[key];
}
} catch (error) {
}
// // console.log(' Go back to the administration page ')
// if (this.$vnode && this.$vnode.data.keepAlive) {
// if (this.$vnode.parent && this.$vnode.parent.componentInstance && this.$vnode.parent.componentInstance.cache) {
// if (this.$vnode.componentOptions) {
// var key = this.$vnode.key == null
// ? this.$vnode.componentOptions.Ctor.cid + (this.$vnode.componentOptions.tag ? `::${this.$vnode.componentOptions.tag}` : '')
// : this.$vnode.key
// var cache = this.$vnode.parent.componentInstance.cache
// var keys = this.$vnode.parent.componentInstance.keys
// if (cache[key]) {
// if (keys.length) {
// var index = keys.indexOf(key)
// if (index > -1) {
// keys.splice(index, 1)
// }
// }
// delete cache["key"]
// debugger;
// }
// }
// }
// }
this.$destroy()
}
next()
},3、 After reaching the target page , Clear the mark
sessionStorage.setItem("cgsqmx","");
边栏推荐
- LaneATT
- Adaptive design and responsive design
- Dynamics crm: sharing records for users and teams
- Experience summary of slow SQL problems
- Reentrantlock reentrant lock
- yolov3 训练自己的数据集
- Will the capital market be optimistic about TCL's folding screen story?
- Error reporting [project error reporting]
- Configuring WAPI certificate security policy for Huawei wireless devices
- Public and private key transmission, and understanding of CA certificate
猜你喜欢

Choice of advanced anti DDoS IP and CDN in case of DDoS

Nine key measures to maintain server security in Hong Kong

Read the paper with me - multi model text recognition network

从哪些维度评判代码质量的好坏?如何具备写出高质量代码的能力?

Multus of kubernetes multi network card scheme_ CNI deployment and basic use

力扣 31.下一个排列--双指针法

Still using listview? Use animatedlist to make list elements move

简化理解:发布订阅

Yolov4 trains its own data set

Automatic derivation of pytorch
随机推荐
Error in anyjson setup command: use_ 2to3 is invalid.
Programming in CoDeSys to realize serial communication [based on raspberry pie 4B]
Nine key measures to maintain server security in Hong Kong
Leetcode 223. 矩形面积
vscode常用快捷键
2022/7/18 CF training
You are only one SQL statement away from the tdengine Developer Conference!
MySQL source code analysis -- data structure of index
Arduino IDE ESP32固件安装和升级教程
【SWT】自定义数据表格
简化理解:发布订阅
华为无线设备配置WAPI-证书安全策略
2.19 haas506 2.0开发教程 - bluetooth - 蓝牙通信(仅支持2.2以上版本)
Automatic derivation of pytorch
Dedecms editor supports automatic pasting of word pictures
[acwing] 909. Chess game
Join parameter processing and @param
[shaders realize pixelate mosaic effect _shader effect Chapter 7]
ReentrantLock 可重入锁
Dynamics crm: sharing records for users and teams