When using vue, after binding the v- model data, you will find that the data in the input box can no longer be modified. Use this.$set() to solve this problem
this.$set(obj, key, value)/vue.set(obj, key, value)
// 显示对话框-修改信息 async showEditDialog(id, name, phone, sex, age){ this.$set(this.editForm, "id", id) this.$set(this.editForm, "name", name) this.$set(this.editForm, "id", phone) this.$set(this.editForm, "name", sex) this.$set(this.editForm, "id", age)
<span class="token comment">//this.editForm.id = id; </span> <span class="token comment">//this.editForm.name = name; </span> <span class="token comment">//this.editForm.phone = phone; </span> <span class="token comment">//this.editForm.sex = sex; </span> <span class="token comment">//this.editForm.age = age; </span> <span class="token keyword">this</span><span class="token punctuation">.</span>editDialogVisible <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span> <span class="token comment">// 开启对话框-修改信息</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
When using vue, after binding the v- model data, you will find that the data in the input box can no longer be modified. Use this.$set() to solve this problem
this.$set(obj, key, value)/vue.set(obj, key, value)
// 显示对话框-修改信息 async showEditDialog(id, name, phone, sex, age){ this.$set(this.editForm, "id", id) this.$set(this.editForm, "name", name) this.$set(this.editForm, "id", phone) this.$set(this.editForm, "name", sex) this.$set(this.editForm, "id", age)
<span class="token comment">//this.editForm.id = id; </span> <span class="token comment">//this.editForm.name = name; </span> <span class="token comment">//this.editForm.phone = phone; </span> <span class="token comment">//this.editForm.sex = sex; </span> <span class="token comment">//this.editForm.age = age; </span> <span class="token keyword">this</span><span class="token punctuation">.</span>editDialogVisible <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span> <span class="token comment">// 开启对话框-修改信息</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>