当前位置:网站首页>Secondary processing of template data
Secondary processing of template data
2022-07-24 06:36:00 【LuciferDawnC】
watch、computed
because watch and computed Very similar So put it together and say
watch:
Monitor the corresponding data changes , Execute the corresponding logical callback .
No cache data , Must be data Data in
Unwanted return
If you need to load and execute, you need to add immediate:true attribute
Applicable to a data change , When affecting multiple pieces of data , Execute the corresponding data logical callback

computed
Monitor multiple data changes , The calculation produces a result .
There is cached data , data Data that does not exist in
need return One result is the result of calculation
The default load will be executed
Applicable to multiple data changes , When the calculation produces a result , Execute the corresponding data logical callback

filters filter
single | The vertical line is the pipe symbol Inject the front data into the rear registration filter function, and then return
<div>{ { data | format }}</div>
Is equivalent to data Import format(data) perform
<div>{ { data | format(val, 'type') }}</div>
At this time data Will be used as the first parameter val Pass in fromat Subsequent parameters can be customized, and arbitrary parameters can be passed in for execution
Single component registration :
filters: {
format (val) {
return 99 ? 99 || val
}
}
Global registration
Vue.filter('format', function (val) {
return 99 ? 99 || val
})
Use :
<div>{ { data | format }}</div>
Reference resources : API — Vue.js
边栏推荐
猜你喜欢

Leetcode sword finger offer jz25 merges two sorted linked lists
![Quickly and simply set up FTP server, and achieve public network access through intranet [no need for public IP]](/img/2a/43ba2839b842e0901a550d2883b883.png)
Quickly and simply set up FTP server, and achieve public network access through intranet [no need for public IP]

Do not rent servers, build your own personal business website (3)

实验:磁盘配额操作

Login page + summary

Jmeter分布式压测

系统安全及应用

项目上复盘引导问题清单

Li Kou 986. Intersection of interval lists

Leetcode refers to the duplicate number in the offer jz3 array
随机推荐
Login page + summary
Tensorflow GPU installation -- 056
自定义zabbix agent rpm包
Metersphere one stop open source continuous testing platform
[226] instructions for Wireshark parameters
Summary of common working methods (7S, SWOT analysis, PDCA cycle, smart principle, 6w2h, time management, WBS, 28 principles)
history命令历史记录中加时间
Leetcode sword finger offer jz73 flip word sequence
Solutions to the failure of wechat TBS online kernel installation
LuckyFrameWeb测试平台(一款支持接口自动化、WEB UI自动化、APP自动化,并且支持分布式测试的全纬度免费开源测试平台)
项目上复盘引导问题清单
Flink state use
Write blog at leisure ~ briefly talk about let, VaR and Const
grep与正则的搭配使用
【222】内存溢出及定位
Configure a fixed remote desktop address [intranet penetration, no need for public IP]
Common commands and package management of go language
Install agent and proxy using custom ZABBIX package (version 4.0.5)
Heap overflow of kernel PWN basic tutorial
RAID5和LVM组合使用