当前位置:网站首页>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>边栏推荐
- LeetCode 1827. Increment array with minimal operation
- What does ft mean in the data book table
- 431. encode n-ary tree as binary tree DFS
- Introduction of Spock unit test framework and its practice in meituan optimization___ Chapter I
- JMeter learning notes 2 - brief introduction to graphical interface
- [ta- frost wolf \u may- hundred people plan] 1.1 rendering pipeline
- 389. find a difference
- [ta - Frost Wolf May - 100 people plan] 1.2.1 base vectorielle
- 互联网行业最佳产品开发流程 推荐!
- LetCode 1829. Maximum XOR value per query
猜你喜欢

Hololens2 development environment building and deploying apps

Chen Yu (Aqua) - Safety - & gt; Cloud Security - & gt; Multicloud security

【发送邮件报错】535 Error:authentication failed

283.移动零

Unity's 3D multi-point arrow navigation

多次跳槽后,月薪等于老同事的年薪

【TA-霜狼_may-《百人计划》】1.2.1 向量基础

25.k sets of flipped linked lists

Knowledge supplement: redis' basic data types and corresponding commands

LeetCode 1828. Count the number of points in a circle
随机推荐
Programs and processes, process management, foreground and background processes
创新界,聚势行 | 2022人大金仓“百城巡展”火热开启
【历史上的今天】6 月 30 日:冯·诺依曼发表第一份草案;九十年代末的半导体大战;CBS 收购 CNET
LeetCode 1399. Count the maximum number of groups
Redis (VII) optimization suggestions
Obtain detailed ideas for ABCDEF questions of 2022 American Games
Knowledge supplement: basic usage of redis based on docker
Valid @suppresswarnings warning name
409. longest palindrome
[TA frost wolf \u may- hundred people plan] 1.2.1 vector basis
Edge浏览器的小技巧:Enter+Ctrl可以自动将地址栏转换为网址
JD intelligent customer service Yanxi intention system construction and intention recognition technology introduction
Note de développement du système embarqué 80: application du concepteur Qt à la conception de l'interface principale
LeetCode 1380. Lucky number in matrix
283. move zero
DO280管理应用部署--RC
[leetcode skimming] February summary (updating)
Visit the image URL stored by Alibaba cloud to preview the thumbnail directly on the web page instead of downloading it directly
基于Unet的环路滤波
Knowledge supplement: redis' basic data types and corresponding commands