当前位置:网站首页>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还支持很多功能,需要自己去查
边栏推荐
- 【 Native cloud】 Éditeur ivx Programmable par tout le monde
- clustermeet
- 人的顶级能量从哪里获取?
- R语言caTools包进行数据划分、scale函数进行数据缩放、class包的knn函数构建K近邻分类器
- Where do people get their top energy?
- The DOTPLOT function in the epidisplay package of R language visualizes the frequency of data points in different intervals in the form of point graphs, specifies the grouping parameters with the by p
- R语言dplyr包intersect函数获取在两个dataframe中都存在的数据行、获取两个dataframe交叉的数据行
- 【云原生】 ”人人皆可“ 编程的无代码 iVX 编辑器
- Program analysis and Optimization - 8 register allocation
- IP certificate application process of sectigo
猜你喜欢

Electron

这才是优美的文件系统挂载方式,亲测有效

Keil4打开单片机工程一片空白,cpu100%程序卡死的问题解决

一篇抄十篇,CVPR Oral被指大量抄袭,大会最后一天曝光!

Talk about the RPA direction planning: stick to simple and valuable things for a long time

Stream常用操作以及原理探索

VMware partial settings

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

The annual salary of 500000 is one line, and the annual salary of 1million is another line

程序分析与优化 - 8 寄存器分配
随机推荐
710. random numbers in the blacklist
Electron
Excel-VBA 快速上手(二、条件判断和循环)
IP certificate application process of sectigo
Unity 利用Skybox Panoramic着色器制作全景图预览有条缝隙问题解决办法
Common operation and Principle Exploration of stream
Numpy basic use
网上股票开户安不安全?谁给回答一下
nvidia-smi 报错
The tablestack function of the epidisplay package of R language makes a statistical summary table (descriptive statistics of groups, hypothesis test, etc.), does not set the by parameter to calculate
The DOTPLOT function in the epidisplay package of R language visualizes the frequency of data points in different intervals in the form of point graphs, specifies the grouping parameters with the by p
使用宝塔面板部署flask环境
Optimizing for vectorization
Unity C# 网络学习(十)——UnityWebRequest(二)
The R language cartools package divides data, the scale function scales data, and the KNN function of the class package constructs a k-nearest neighbor classifier
在云服务器中云磁盘如何挂载
C语言刷题随记 —— 乒乓球比赛
Document 1
R language uses ggplot2 to visualize the results of Poisson regression model and count results under different parameter combinations
feil_uVission4左侧工目录消失