VUE的watch computed

watch computed 使用及理解概念

img

watch 使用理解

v-model 绑定input input 一个对象来理解

(val) 就是当前的v-model 的value 值 动态监听 数据变化执行事件

computed 绑定input 这个变量 input 变动 才执行绑定的这个函数

然后 return 才能返回值 这个函数 对应的的 值就是return 返回的值

函数就相当 key

相当与绑定 某个值 监听变化

input 动态监听 还有原生的方法 @input=””