当前位置:网站首页>vue-router路由缓存
vue-router路由缓存
2022-07-29 06:34:00 【二七二十七】
- 作用:让不展示的路由组件保持挂载,不被销毁
- 使用
<keep-alive></keep-alive>标签实现路由缓存,使用该标签包裹<router-view></router-view>标签,可以使通过路由在<router-view></router-view>位置处展示的组件全部进行缓存 - 在实际开发中只需要将部分组件进行缓存,通过
<keep-alive></keep-alive>标签中的include属性实现,指定include属性的属性值为需要进行缓存的组件名即可; - 若需要指定多个进行缓存的组件,将include属性的属性值为数组,在数组中放入组件名即可
// 缓存在<router-view></router-view>位置处展示的所有组件 <keep-alive> <router-view></router-view> </keep-alive> // 缓存在<router-view></router-view>位置处展示的单个指定组件 <keep-alive include="组件名"> <router-view></router-view> </keep-alive> // 缓存在<router-view></router-view>位置处展示的多个指定组件 <keep-alive include="['组件名1', '组件名2']"> <router-view></router-view> </keep-alive>
边栏推荐
- JS 鸡生蛋与蛋生鸡问题,Object与Function究竟谁出现的更早?Function算不算Function的实例?
- Improved Pillar with Fine-grained Feature for 3D Object Detection论文笔记
- [CF1054H] Epic Convolution——数论,卷积,任意模数NTT
- Problems encountered in vmware16 installing virtual machines
- MVFuseNet:Improving End-to-End Object Detection and Motion Forecasting through Multi-View Fusion of
- Revolution of game assets
- 2022-07-28:以下go语言代码输出什么?A:AA;B:AB;C:BA;D:BB。 package main import ( “fmt“ ) func main() { f
- [C language brush leetcode] 67. binary sum (E)
- gin 路由,参数,输出
- 怎么会不喜欢呢,CICD中轻松发送邮件
猜你喜欢

Ansible中的变量及加密

CAN&CANFD综合测试分析软件LKMaster与PCAN-Explorer 6分析软件的优势对比

接口测试实战项目03:执行测试用例

后缀自动机(SAM)讲解 + Luogu p3804【模板】后缀自动机 (SAM)
![[Charles' daily problems] when you open Charles, you can't use nails](/img/ef/037fc416175d4de769ac6484cb53df.png)
[Charles' daily problems] when you open Charles, you can't use nails

【charles日常问题】开启charles,使用不了钉钉

buck电路boot和ph引脚实测

ETL为什么经常变成ELT甚至LET?

Guess the number / / generate a random number for the first time

MutationObserver文档学习
随机推荐
【C语言刷LeetCode】2332. 坐上公交的最晚时间(M)
Thread - thread safety - thread optimization
pytorch的技巧记录
MySQL - multi table query
【C语言刷LeetCode】1054. 距离相等的条形码(M)
Unity发送Post请求给GoLang服务端解析并返回
建木持续集成平台v2.5.2发布
SSH免密登录-两台虚拟机建立免密通道 双向信任
Simulation volume leetcode [ordinary] 172. Zero after factorial
Salesforce中过滤器Filter使用的相对日期
Flink real-time warehouse DWD layer (order placing multiple tables to realize join operation) template code
[C language brush leetcode] 2332. The latest time to get on the bus (m)
Hj37 statistics of the total number of rabbits per month Fibonacci series
Win11vmware turns on the virtual machine and restarts on the blue screen and the solution that cannot be started
解决CSDN因版权不明而无法发布博客的问题
数组的子集不能累加出的最小正数
1172. The plate stack has a sequence table + stack
Flink实时仓库-DWD层(kafka-关联mysql的lookup join)模板代码
IO stream - file - properties
[C language brush leetcode] 67. binary sum (E)