当前位置:网站首页>Learn Chapter 20 of vue3 (keep alive cache component)
Learn Chapter 20 of vue3 (keep alive cache component)
2022-07-01 04:13:00 【Xiaoman ZS】
Built in components keep-alive
Sometimes we don't want components to be re rendered to affect the user experience ; Or in terms of performance , Avoid repeated rendering to reduce performance . I want the components to be cached , Maintain the current state . And that's where it comes in keep-alive Components .
Turn on keep-alive Life cycle change
- When I first entered : onMounted> onActivated
- Trigger after exit
deactivated - Once again into the :
- It will only trigger onActivated
- How to mount the event, etc , The one-time execution is placed in onMounted in ; Every time a component goes in, its execution method is placed in onActivated in
<!-- basic -->
<keep-alive>
<component :is="view"></component>
</keep-alive>
<!-- Sub components of multiple conditional judgments -->
<keep-alive>
<comp-a v-if="a > 1"></comp-a>
<comp-b v-else></comp-b>
</keep-alive>
<!-- and `<transition>` Use it together -->
<transition>
<keep-alive>
<component :is="view"></component>
</keep-alive>
</transition> include and exclude
<keep-alive :include="" :exclude="" :max=""></keep-alive>include and exclude prop Allow components to conditionally cache . Both can be comma separated strings 、 Regular expressions or an array to represent :
max
<keep-alive :max="10">
<component :is="view"></component>
</keep-alive>边栏推荐
- Coinbase in a bear market: losses, layoffs, stock price plunges
- “目标检测“+“视觉理解“实现对输入图像的理解
- 什么是权限?什么是角色?什么是用户?
- Deep learning | rnn/lstm of naturallanguageprocessing
- 浏览器顶部loading(来自知乎)
- [recommended algorithm] C interview question of a small factory
- 168. excel table column name
- HoloLens2开发环境搭建及部署app
- Usage of AfxMessageBox and MessageBox
- In the innovation community, the "100 cities Tour" of the gold warehouse of the National People's Congress of 2022 was launched
猜你喜欢

431. 将 N 叉树编码为二叉树 DFS

283.移动零
![[ta- frost wolf \u may- hundred people plan] 1.1 rendering pipeline](/img/af/4498382bc47d8c9ae41c407b9d1265.png)
[ta- frost wolf \u may- hundred people plan] 1.1 rendering pipeline

TS type gymnastics: illustrating a complex advanced type

基于Unet的环路滤波

One job hopping up 8K, three times in five years

Millet College wechat scanning code login process record and bug resolution

Why can't you find the corresponding function by clicking go to definiton (super easy has a diagram)
![[TA frost wolf \u may- hundred people plan] 1.2.1 vector basis](/img/94/99090ea91082a385968e071ef3766c.png)
[TA frost wolf \u may- hundred people plan] 1.2.1 vector basis

Unity之三维空间多点箭头导航
随机推荐
盘点华为云GaussDB(for Redis)六大秒级能力
[TA frost wolf \u may- hundred talents plan] 1.2.3 MVP matrix operation
Obtain detailed ideas for ABCDEF questions of 2022 American Games
“目标检测“+“视觉理解“实现对输入图像的理解
Chen Yu (Aqua) - Safety - & gt; Cloud Security - & gt; Multicloud security
Account sharing technology enables the farmers' market and reshapes the efficiency of transaction management services
After many job hopping, the monthly salary is equal to the annual salary of old colleagues
Loop filtering based on Unet
Jenkins automatically cleans up construction history
【人话版】WEB3黑暗森林中的隐私博弈
Quickly filter data such as clock in time and date: Excel filter to find whether a certain time point is within a certain time period
Coinbase in a bear market: losses, layoffs, stock price plunges
214. minimum palindrome string
Edge浏览器的小技巧:Enter+Ctrl可以自动将地址栏转换为网址
Deep learning | rnn/lstm of naturallanguageprocessing
Valid @suppresswarnings warning name
What is uid? What is auth? What is a verifier?
嵌入式系统开发笔记79:为什么要获取本机网卡IP地址
Note de développement du système embarqué 80: application du concepteur Qt à la conception de l'interface principale
171. excel table column No