当前位置:网站首页>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","");
边栏推荐
- 从哪些维度评判代码质量的好坏?如何具备写出高质量代码的能力?
- JUC source code learning note 3 - AQS waiting queue and cyclicbarrier, BlockingQueue
- 2.19 haas506 2.0开发教程 - bluetooth - 蓝牙通信(仅支持2.2以上版本)
- Leetcode 223. rectangular area
- iptables常用命令小清单
- [shaders realize pixelate mosaic effect _shader effect Chapter 7]
- Scala functions and their higher-order applications
- Arduino IDE ESP32固件安装和升级教程
- Kubernetes static storage and dynamic storage
- 微调LayoutLM v3进行票据数据的处理和内容识别
猜你喜欢

Join parameter processing and @param

Leetcode 231. 2 的幂

There are more than 20 categories of the four operators in MySQL. It took three days and three nights to sort them out. Don't collect them quickly

Leetcode 220. duplicate element III exists

yolov6训练自己的数据集

Reentrantlock reentrant lock

faster-rcnn 训练自己的数据集

微调LayoutLM v3进行票据数据的处理和内容识别

How to deal with being attacked? Advanced anti DDoS IP protection strategy

Memorythrashing: Tiktok live broadcast to solve memory dithering practice
随机推荐
Knowledge points of MySQL (12)
yolov3 训练自己的数据集
Vscode common shortcut keys
Reentrantlock reentrant lock
kubernetes GPU的困境和破局
2022/7/18 CF training
JUC source code learning note 3 - AQS waiting queue and cyclicbarrier, BlockingQueue
Leetcode 220. 存在重复元素 III
Hard core innovation that database needs to care about in the future
Read the paper with me - multi model text recognition network
[quantitative test]
Experience summary of slow SQL problems
Lsyncd set up synchronous image - use lsyncd to realize real-time synchronization between local and remote servers
C# - partial 关键字
JUC源码学习笔记3——AQS等待队列和CyclicBarrier,BlockingQueue
Yolov6 trains its own data set
How to choose the appropriate data type for fields in MySQL?
mysql源码分析——索引的数据结构
Dynamics 365: explain virtual entity from 0 to 1
Leetcode 223. 矩形面积