Vue2显示动态添加表单






提交方法:

/** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          const form = Object.assign({}, this.form);
          form.website = JSON.stringify(this.form.website)
          form.system = JSON.stringify(Object.assign({}, this.systemJson))
          form.hardware = JSON.stringify(Object.assign({}, this.hardwareJson))
          if (this.form.wid != null) {
            updateOwner(form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addOwner(form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },

 

你可能感兴趣的:(vue.js,elementui,javascript)