当前位置:网站首页>Calculate properties and listeners
Calculate properties and listeners
2022-07-29 00:29:00 【qiansli12138】
Concept : Computing attributes are generally used for more complex operations , Write directly in html The page will appear very bloated , There is the concept of computing attributes . Listeners are derived to assist in computing properties , Perform asynchronous or expensive operations when data changes , Limited choice of listeners .
When and how ? This needs continuous accumulation in practical application . There are probably the following scenes :
Use calculated properties :
1. Data that requires simple mathematical calculations , For example, the little red dot on the shopping cart , You need to calculate the length of the array in the background ~~~
2. Routing data , For example, carry url~~
3.vuex The value in , For example, existence vuex The value of the sum of ~~
4. Changing one of these values will affect the other values ~~ for instance firstname and seconedname, Will affect fullname, Just use the calculation properties
Using listeners :
1. For asynchronous operation , Choose it first
2. Expensive , I don't know how to understand this , You can leave a message if you know
3. Changing a value will affect many values , For example, to show firsname, But he was fullname Part of , You can listen with a listener firstname that will do .
My understanding is that .
边栏推荐
- Software designer afternoon question
- IDEA2021.2安装与配置(持续更新)
- Visual full link log tracking
- [micro services ~nacos] Nacos service providers and service consumers
- html+css+php+mysql实现注册+登录+修改密码(附完整代码)
- 15.模型评估和选择问题
- 动态规划问题(四)
- Dynamic programming problem (1)
- 【开发教程11】疯壳·开源蓝牙心率防水运动手环-整机功能代码讲解
- PTA (daily question) 7-69 narcissus number
猜你喜欢

PTA (daily question) 7-75 how many people in a school

还在写大量 if 来判断?一个规则执行器干掉项目中所有的 if 判断...

最长上升子序列

12个MySQL慢查询的原因分析

#{}和${}的区别

110 MySQL interview questions and answers (continuously updated)

Attack and defense world web master advanced area web_ php_ include

动态规划问题(三)

Oracle实例无法启动的问题如何解决

Table custom style row class name in elemenui
随机推荐
Samsung asset management (Hong Kong) launched yuancosmos ETF to focus on investing in the future tuyere track
2022DASCTF7月赋能赛(复现)
动态规划问题(二)
Teach you how to install latex (nanny level tutorial)
Sword finger offer 64. find 1+2+... +n, logical operator short circuit effect
乱打日志的男孩运气怎么样我不知道,加班肯定很多!
Attack and defense world web master advanced area php2
IDEA2021.2安装与配置(持续更新)
PTA (daily question) 7-70 diamond
Advanced area of attack and defense world web masters ics-06
MySQL sub database and sub table and its smooth expansion scheme
PTA (daily question) 7-77 encryption
Flyway's quick start tutorial
@PostConstruct注解详解
Sword finger offer 41. median in data flow
动态规划问题(三)
Dynamic programming problem (6)
动态规划问题(一)
Alibaba code index technology practice: provide reading experience of local IDE for code review
Google browser, no installation required