使用vue时,当对v-model的数据进行了绑定以后,会发现无法再修改输入框的的数据,使用this.$set()可以解决这个问题

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)

      //this.editForm.id = id;  
      //this.editForm.name = name;  
      //this.editForm.phone = phone; 
      //this.editForm.sex = sex; 
      //this.editForm.age = age; 
      this.editDialogVisible = true; // 开启对话框-修改信息
    },
Logo

前往低代码交流专区

更多推荐