<el-input v-model="this.value.name"></el-input> // 这是在一个方法中给value赋值了,方法是直接触发的 this.value.name = "zs"
问题是,赋值之后原本的input 框中就出现了100,但是不能修改了。
原因是:vue不允许在已经创建的实例上添加新的根级响应式属性,但可以通过set添加。
所以解决办法就是把上面赋值这句代码修改为:
this.$set(this.value, "name", "zs")
到此,成功解决。