当前位置:网站首页>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
边栏推荐
- Common commands and package management of go language
- Backup MySQL database with bat script under Windows
- Flink checkpoint configuration details
- Wasm vs EVM, Boca's choice predicts the future of the public chain
- Leetcode sword finger offer jz23: the entry node of the link in the linked list
- Log collection and analysis platform
- JSP tag
- Flink state use
- Metersphere one stop open source continuous testing platform
- [award issuance] the results of the first essay solicitation activity in oneos zone were announced
猜你喜欢

Flex layout

联合国农产品数据分析

常用工作方法总结(7S、SWOT分析、PDCA循环、SMART原则、6W2H、时间管理、WBS、二八原则)

Custom MVC 2.0

How to build a website full of ritual sense and publish it on the public website 1-2

Combination of grep and regular

FTP service and experiment

Jenkins自动化无人值守运行(上/下)

List of problems in the re disk guidance of the project

Do not rent a server, build your own personal business website (how to buy a domain name)
随机推荐
Windows下Mysql5.7忘记root密码解决方法
Multiple types of functions
一批面试题及答案_20180403最新整理
迭代器与生成器
Data set and pre training model
Unable to boot after permanent mounting
Remember to get the password of college student account once, from scratch
go语言的快速上手
Backup MySQL database with bat script under Windows
DNS域名解析服务
Do not rent servers, build your own personal business website (3)
Leetcode sword finger offer jz73 flip word sequence
PXE technology network installation
【222】内存溢出及定位
Polkadot | interprets how liberty plan, which subverts traditional social media, will be launched in Poka
[301] grotesque behavior - predictable irrationality
JSP tag
账号和权限管理
RAID5和LVM组合使用
FTP服务与实验