当前位置:网站首页>若依 this.$router.push 同地址不同参,页面不刷新问题
若依 this.$router.push 同地址不同参,页面不刷新问题
2022-07-24 15:41:00 【Teln_小凯】
背景:若依框架里面默认页面都是缓存的,使用this.$router.push 同地址不同参打开页面时,页面也默认缓存了,导致数据不刷新。
解决办法:
1、打开页面前创建一个标记
sessionStorage.setItem("cgsqmx","Refresh");2、离开页面时发现有这个标记,然后删若依缓存
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('返回管理页面')
// 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、到达目标页面后,清空标记
sessionStorage.setItem("cgsqmx","");
边栏推荐
- memcache缓存应用(LNMP+memcache)
- Kubernetes version docking object storage
- 2022 / 7 / 20 training record
- 维护香港服务器安全的9个关键措施
- Kubernetes版本对接对象存储
- 上课作业(6)——#575. 单词的划分(word)
- [fluent -- layout] flow layout (flow and wrap)
- sklearn.metrics模块模型评价函数
- Do you understand the working principle of gyroscope?
- 【着色器实现Pixelate马赛克效果_Shader效果第七篇】
猜你喜欢

Automatic derivation of pytorch

You are only one SQL statement away from the tdengine Developer Conference!
![[SWT] user defined data table](/img/bf/a0c60f1ac9461874b8a573f805e1fe.png)
[SWT] user defined data table

Which is a good noise reduction Bluetooth headset? Ranking of the most cost-effective noise reduction Bluetooth headsets

kubernetes多网卡方案之Multus_CNI部署和基本使用

有了这个机器学习画图神器,论文、博客都可以事半功倍了!

什么是防火墙?防火墙能发挥什么样的作用?

Yolo5face: why reinvent the face detector

【Flutter -- 布局】流式布局(Flow和Wrap)

Kubectl_好用的命令行工具:oh-my-zsh_技巧和窍门
随机推荐
MATLAB image defogging technology GUI interface - global balance histogram
Kubectl_ Easy to use command line tool: Oh my Zsh_ Tips and tricks
Dynamics 365: how to get the threshold value of executemullerequest in batch requests
未来数据库需要关心的硬核创新
Arduino IDE ESP32固件安装和升级教程
R语言ggplot2可视化:ggplot2可视化基本散点图(scatter plot)、通过在theme_bw中指定参数base_size来改变轴标签的大小、并控制网格线和轴标签的大小
yolov6训练自己的数据集
Sklearn.metrics module model evaluation function
Kubernetes版本对接对象存储
基于Lambert函数的时滞系统稳定性研究
Kubectl_好用的命令行工具:oh-my-zsh_技巧和窍门
You are only one SQL statement away from the tdengine Developer Conference!
【TA-霜狼_may-《百人计划》】图形3.4 延迟渲染管线介绍
MySQL学习笔记(总结)
Automatic derivation of pytorch
Yolo5face: why reinvent the face detector
Read the paper with me - multi model text recognition network
Dynamics 365: how to get the authentication information required to connect to D365 online from azure
中信证券账户开通流程,手机上开户安全吗
【洛谷】P1908 逆序对