当前位置:网站首页>vue中缓存页面 keepAlive使用
vue中缓存页面 keepAlive使用
2022-06-26 14:47:00 【一只金牛座的崽】
- 在路由中配置
{
path: '',
name: 'xx',
meta: {
keepAlive: true },
component: xx
},
- 在App.vue中配置
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive" :key="key">
</router-view>
computed: {
key() {
return this.$route.path + Math.random();
},
},
- 独有的生命周期
//进入时触发
activated() {
}
//退出时触发
deactivated() {
}
keepAlive还支持很多功能,需要自己去查
边栏推荐
- Numpy基本使用
- Program analysis and Optimization - 8 register allocation
- 北京银行x华为:网络智能运维夯实数字化转型服务底座
- R language dplyr package summary_ The at function calculates the mean and median of multiple data columns (specified by vectors) in the dataframe data, and specifies na RM parameter configuration dele
- This is the graceful file system mounting method, which is effective through personal testing
- Get the intersection union difference set of two dataframes
- 乐鑫 AWS IoT ExpressLink 模组达到通用可用性
- The heavyweight white paper was released. Huawei continues to lead the new model of smart park construction in the future
- Electron
- Keil4打开单片机工程一片空白,cpu100%程序卡死的问题解决
猜你喜欢

Use abp Zero builds a third-party login module (II): server development

【soloπ】adb连接单个多个手机

聊聊 RPA 方向的规划:简单有价值的事情长期坚持做

C语言刷题随记 —— 乒乓球比赛

Unity 利用Skybox Panoramic着色器制作全景图预览有条缝隙问题解决办法

赠书 | 《认知控制》:我们的大脑如何完成任务?

Mathematical modeling of war preparation 30 regression analysis 2

Stream常用操作以及原理探索

印尼投资部长:鸿海考虑在其新首都建立电动公交系统、城市物联网

Naacl2022: (code practice) good visual guidance promotes better feature extraction, multimodal named entity recognition (with source code download)
随机推荐
NVIDIA SMI error
程序分析与优化 - 8 寄存器分配
Is it safe for flush to register and open an account? Is there any risk?
券商经理给的开户链接办理股票开户安全吗?我想开个户
Can wptx64 be uninstalled_ Which software of win10 can be uninstalled
一个快速切换一个底层实现的思路分享
R语言使用ggplot2可视化泊松回归模型(Poisson Regression)的结果、可视化不同参量组合下的计数结果
Declaration and assignment of go variables
Login authentication service
重磅白皮书发布,华为持续引领未来智慧园区建设新模式
Excerpt from three body
Is it safe to open a stock account with the account manager online??
qt下多个子控件信号槽绑定方法
R语言epiDisplay包的dotplot函数通过点图的形式可视化不同区间数据点的频率、使用by参数指定分组参数可视化不同分组的点图分布、使用cex.X.axis参数指定X轴轴刻度数值标签字体的大小
BM3D in popular language
R language GLM function logistic regression model, using epidisplay package logistic The display function obtains the summary statistical information of the model (initial and adjusted odds ratio and
使用宝塔面板部署flask环境
Pytorch深度学习代码技巧
VMware partial settings
NAACL2022:(代码实践)好的视觉引导促进更好的特征提取,多模态命名实体识别(附源代码下载)...