PHP前端开发

vue中watch和computed的区别

百变鹏仔 3周前 (09-25) #VUE
文章标签 区别
vue 中 watch 用于观察数据变化并执行回调函数,而 computed 用于创建基于其他响应式数据的计算属性。

Vue 中 watch 和 computed 的区别

简单回答:

watch 用于观察数据变化并执行回调函数,而 computed 用于创建基于其他响应式数据的计算属性。

详细回答:

立即学习“前端免费学习笔记(深入)”;

watch

  • 缺点:

  • computed

  • 缺点:

  • 总结: