当前位置:网站首页>新增指令 v-memo
新增指令 v-memo
2022-08-02 19:48:00 【大象与小蚂蚁的生活】
v-memod会记住一个模板的子树,元素和组件上都可以使用。
该指令接收一个固定长度的数组作为依赖值进行[记忆比对]。
如果数组中的每个值都和上次渲染的时候相同,则整个子树的更新会被跳过。
即使是虚拟 DOM 的 VNode 创建也将被跳过,因为子树的记忆副本可以被重用。
因此渲染的速度会非常的快。
需要注意得是:正确地声明记忆数组是很重要。
开发者有责任指定正确的依赖数组,以避免必要的更新被跳过。
<li v-for="item in listArr" :key="item.id" v-memo="['valueA','valueB']">
{
{
item.name }}
</li>
v-memod的指令使用较少,它的作用是:缓存模板中的一部分数据。
只创建一次,以后就不会再更新了。也就是说用内存换取时间。
边栏推荐
- Flutter自带国际化适配自动生成方案
- MySQL安装配置教程(超级详细)
- JWT学习
- 使用位运算实现加减乘除(+、-、*、/)及比较器的用法
- [安洵杯 2019]easy_web
- APP自动化uiautomator2获取toast
- 当TIME_WAIT状态的TCP正常挥手,收到SYN后…
- J9 digital theory: the Internet across chain bridge has what effect?
- Parse common methods in the Collection interface that are overridden by subclasses
- 【 LeetCode 】 1374. Generate each character string is an odd number
猜你喜欢

程序员也许都缺一个“二舅”精神

Flutter自带国际化适配自动生成方案

技术分享 | Apache Linkis 快速集成网页IDE工具 Scriptis

Thread线程类基本使用(上)

谷歌竞价机器学习如何去理解?

7月29-31 | APACHECON ASIA 2022

MySQL安装时一直卡在starting server

ShardingSphere-proxy +PostgreSQL implements read-write separation (static strategy)

Fiddle设置接口数据用指定工具查看;Sublime Text设置json数据格式化转换

PG's SQL execution plan
随机推荐
如何ES源码中添加一个自己的API 流程梳理
The so-called fighting skill again gao also afraid of the chopper - partition, depots, table, and the merits of the distributed
AI Scientist: Automatically discover hidden state variables of physical systems
Silver circ: letter with material life insurance products should be by the insurance company is responsible for the management
J9数字货币论:识别Web3新的稀缺性:开源开发者
ALV概念讲解
清除浮动与BFC
MySQL安装时一直卡在starting server
【LeetCode】1374. 生成每种字符都是奇数个的字符串
A Review of Nature Microbiology: Focusing on the Algae--Ecological Interface of Phytoplankton-Bacteria Interactions
LeetCode - 105. 从前序与中序遍历序列构造二叉树;023.合并K个升序链表
「面试必会」这应该是最有深度的TCP三次握手、四次挥手细节讲解
【LeetCode】622. 设计循环队列
golang刷leetcode 动态规划(13) 最长公共子序列
Brain-computer interface 003 | Musk said that he has realized a virtual self-dialogue with the cloud, and related concept shares have risen sharply
OpenCV开发中的内存管理问题
所谓武功再高也怕菜刀-分区、分库、分表和分布式的优劣
服务器Centos7 静默安装Oracle Database 12.2
Geoserver + mysql + openlayers problem
【Psychology · Characters】Issue 1