方法,计算属性和过滤器之间的区别?
我只是回到Vue开发中,对某些主题有些生锈。有人可以解释方法,计算属性和过滤器之间的区别,并描述何时应该使用?
我的理解是,每次对状态进行一些更改时都会调用方法,而仅在对使用特定变量进行更改时,计算的属性和过滤器才会被调用。这是正确的吗?
说滤波器与计算属性基本相同,但是可以采用参数,哪些计算属性不能?
我感谢我对此的任何帮助
I'm just getting back into Vue development and am a bit rusty on certain topics. Could somebody explain the difference between methods, computed properties, and filters, as well as describe when each should be used?
It is my understanding that methods are invoked every time some change is made to the state, whereas computed properties and filters are invoked only when change is made to a specific variable that they are using. Is this correct?
Is it correct to say that filters are essentially the same as computed properties, but can take parameters, which computed properties cannot?
I am grateful for any help with my understanding of this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论