vue 为form 表单赋值 获取form表单的值

为form表单赋值
this.form.setFieldsValue({ hosName: this.hostData.hosName, //前面的值为表单中的值 hosCode: this.hostData.hosCode, hosTypeName: this.hostData.hosType, hosCategoryName: this.hostData.hosCategory, })
获取表单中的值
 this.form.validateFieldsAndScroll((err, values) => {
      
hosName:values.hosName })
 
//指定form指向
 beforeCreate() {
    this.form = this.$form.createForm(this);
  },

 

转载于:https://www.cnblogs.com/lvlvlv/p/11556613.html

你可能感兴趣的:(javascript)