当前位置:网站首页>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","");
边栏推荐
- MySQL学习笔记(总结)
- 公钥私钥传输,以及对CA证书的理解
- Class assignment (6) - 575. Word division (word)
- 你不能只会flex居中布局,精制动画讲解所有flex布局方式!通俗易懂纯干货教程!...
- Force button 31. Next arrangement -- double finger needling
- Leetcode 220. duplicate element III exists
- Exomeiser annotates and prioritizes exome variants
- OpenMP入门
- Hard core innovation that database needs to care about in the future
- JUC源码学习笔记3——AQS等待队列和CyclicBarrier,BlockingQueue
猜你喜欢

What is a firewall? What role can firewalls play?

C - partial keyword
![[SWT] scrolling container to realize commodity list style](/img/84/07e7c794aaef3fb64f173b50150b21.png)
[SWT] scrolling container to realize commodity list style
![[SWT] user defined data table](/img/bf/a0c60f1ac9461874b8a573f805e1fe.png)
[SWT] user defined data table

Will the capital market be optimistic about TCL's folding screen story?

MySQL learning notes (summary)

You are only one SQL statement away from the tdengine Developer Conference!
![[adaptiveavgpool3d] pytorch tutorial](/img/d0/60ee74ff554effa06084d5d01a03e1.png)
[adaptiveavgpool3d] pytorch tutorial

降噪蓝牙耳机哪个好?性价比最高的降噪蓝牙耳机排行

ReentrantLock 可重入锁
随机推荐
Which is a good noise reduction Bluetooth headset? Ranking of the most cost-effective noise reduction Bluetooth headsets
Personal practical experience: Data Modeling "whether account data belongs to dimension or account domain"
Automatic derivation of pytorch
力扣 31.下一个排列--双指针法
MySQL学习笔记(总结)
Experience summary of slow SQL problems
What is a firewall? What role can firewalls play?
You are only one SQL statement away from the tdengine Developer Conference!
降噪蓝牙耳机哪个好?性价比最高的降噪蓝牙耳机排行
Leetcode 231. 2 的幂
Dynamics crm: how to set the order of forms
【SWT】滚动容器实现商品列表样式
Yolo5face: why reinvent the face detector
yolov4 训练自己的数据集
Feign for 20 minutes every day
mysql源码分析——索引的数据结构
faster-rcnn 训练自己的数据集
Do you understand the working principle of gyroscope?
ReentrantLock 可重入锁
Arduino ide esp32 firmware installation and upgrade tutorial