如题,本人遇到的bug是:
动态新增v-for数据源,里面有下拉框,下拉框切换时其后面的输入框会发生变化,同时也会重置清空v-model,这就导致无法输入的问题
因此使用了this.$set(OriginData(Array/Object), key/index, tragetData)
三个参数:1、源数据,可以是数组或者对象
2、修改的目标, 数组时下标、对象是key
3、替换的新数据
注:Vue.set()全局注册,组件使用this.$set(),基于Object.defineproperty()来监控和修改源数据。