Skip to content
New issue

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

在watch和methods您是如何权衡这两个方法之间的界限的呢。 #1

Closed
lidazhao opened this issue Jul 1, 2017 · 1 comment

Comments

@lidazhao
Copy link

lidazhao commented Jul 1, 2017

在canvas的的静态运用,让人眼前一亮,是个十分好的canvas和vue结合的例子。
在项目中很少看到您使用watch,您是如何判断何时使用methods而不是watch.感谢。

@hzzly
Copy link
Owner

hzzly commented Jul 3, 2017

当时写这个的时候vue还没玩的好,所以多数用的methods。watch是用来响应数据的变化,当data或state中的数据变化时可以用watch来监听。mtehods是用来处理某种事件或动作。

@hzzly hzzly closed this as completed Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants