We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
区别: 1、定义和语义的区别。 2、处理数据的场景不同:watch适合一个数据影响多个数据,而computed适合多个数据影响一个数据。 3、computed有缓存性。计算所得的值如果没有变化则不重复执行。watch提供了更通用的方法,适合执行异步操作和较大开销操作的情况。
具体怎么选用就看自己项目的业务逻辑了,如果是多个数据影响一个数据,且需要做缓存,则适合用computed,如果是一个多数据影响多个数据且有较大开销的操作则适合用watch。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
区别:
1、定义和语义的区别。
2、处理数据的场景不同:watch适合一个数据影响多个数据,而computed适合多个数据影响一个数据。
3、computed有缓存性。计算所得的值如果没有变化则不重复执行。watch提供了更通用的方法,适合执行异步操作和较大开销操作的情况。
具体怎么选用就看自己项目的业务逻辑了,如果是多个数据影响一个数据,且需要做缓存,则适合用computed,如果是一个多数据影响多个数据且有较大开销的操作则适合用watch。
The text was updated successfully, but these errors were encountered: