当前位置:网站首页>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还支持很多功能,需要自己去查
边栏推荐
- Idea shortcut key
- TS常用数据类型总结
- 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
- 一个快速切换一个底层实现的思路分享
- MHA high availability coordination and failover
- R language uses ggplot2 to visualize the results of Poisson regression model and count results under different parameter combinations
- Talk about the RPA direction planning: stick to simple and valuable things for a long time
- 程序分析与优化 - 8 寄存器分配
- Mark一下 Unity3d在Inspector中选中不了资源即Project锁定问题
- It's natural for the landlord to take the rent to repay the mortgage
猜你喜欢
The heavyweight white paper was released. Huawei continues to lead the new model of smart park construction in the future
【 Native cloud】 Éditeur ivx Programmable par tout le monde
备战数学建模31-数据插值与曲线拟合3
710. random numbers in the blacklist
在云服务器中云磁盘如何挂载
Mark一下 Unity3d在Inspector中选中不了资源即Project锁定问题
【soloπ】adb连接单个多个手机
C语言刷题随记 —— 乒乓球比赛
【雲原生】 ”人人皆可“ 編程的無代碼 iVX 編輯器
详解C语言编程题:任意三条边能否构成三角形,输出该三角形面积并判断其类型
随机推荐
redis集群的重新分片与ASK命令
IP certificate application process of sectigo
使用 Abp.Zero 搭建第三方登录模块(一):原理篇
710. random numbers in the blacklist
Redis事务与watch指令
打新债注册开户安全吗,有没有什么风险?
Unity 利用Skybox Panoramic着色器制作全景图预览有条缝隙问题解决办法
MHA high availability coordination and failover
What is the ranking of Guosen Securities? Is it safe to open a stock account?
手机股票注册开户安全吗,有没有什么风险?
设计人员拿到的工程坐标系等高线CAD图如何加载进图新地球
Mathematical modeling of war preparation 30 regression analysis 2
集群中命令的执行过程
【 Native cloud】 Éditeur ivx Programmable par tout le monde
One copy ten, CVPR oral was accused of plagiarizing a lot, and it was exposed on the last day of the conference!
The JVM outputs GC logs, causing the JVM to get stuck. I am stupid
详解C语言编程题:任意三条边能否构成三角形,输出该三角形面积并判断其类型
券商经理给的开户二维码安全吗?找谁可以开户啊?
Pod of kubernetes
乐鑫 AWS IoT ExpressLink 模组达到通用可用性