当前位置:网站首页>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 .
边栏推荐
- 动态规划问题(一)
- MySQL transaction (this is enough...)
- Plato farm is expected to further expand its ecosystem through elephant swap
- Immutable x officially opens IMX token pledge detailed IMX pledge introduction optimistic about the development prospect of IMX
- 2022DASCTF7月赋能赛(复现)
- Installation and use of pnpm
- Html+css+php+mysql realize registration + login + change password (with complete code)
- PTA (daily question) 7-70 diamond
- Talk about seven ways to realize asynchronous programming
- vulnhub:Sar
猜你喜欢
Solutions such as failed plug-in installation and slow speed of linking remote server under vscode
html+css+php+mysql实现注册+登录+修改密码(附完整代码)
Okaleido ecological core equity Oka, all in fusion mining mode
Use hutool tool class to operate excel with more empty Sheet1
Simple use and understanding of laravel message queue
vulnhub:SolidState
110 MySQL interview questions and answers (continuously updated)
MySql中的like和in走不走索引
Router view cannot be rendered (a very low-level error)
Linux下安装Mysql5.7,超详细完整教程,以及云mysql连接
随机推荐
How to learn R language
2022网络安全学习路线 非常详细 推荐学习
Sword finger offer 64. find 1+2+... +n, logical operator short circuit effect
PTA (daily question) 7-74 yesterday
手把手教你安装Latex(保姆级教程)
NFTScan 与 NFTPlay 在 NFT 数据领域达成战略合作
MySQL事务(transaction) (有这篇就足够了..)
Dynamic programming problem (1)
Oracle实例无法启动的问题如何解决
PTA (daily question) 7-75 how many people in a school
Google browser, no installation required
Sword finger offer 55 - I. depth of binary tree
Event extraction and documentation (2008-2017)
动态规划问题(七)
【esn】 学习回声状态网络
“吃货联盟定餐系统”
Api 接口优化有哪些技巧?
DCAT in laravel_ Admin preliminary use record
What does the expression > > 0 in JS mean
Basic knowledge of PHP language (super detailed)