触发对整个表单的验证:this.$refs.userForm.validate();
   触发对表单部分字段的验证:this.$refs.userForm.validateField("password");
 <avue-form v-model="form" ref='form' :option="option" @submit="submit">
        <template slot-scope="scope" slot="templateContent">
          <Tinymce ref="editor" v-model="form.templateContent" :height="200" @input="manualTrigger" :disable='isEdit' />
        </template>
      </avue-form>
 {
          label: '模板内容', prop: 'templateContent', span: 24, formslot: true,
          rules: [{ required: true, message: "请输入模板内容", trigger: "change" }],
   },
    manualTrigger(v) {
      this.content = v.trim();
      console.log(v)
      this.$refs.form.validateField('templateContent');//手动触发校验
    },
Logo

前往低代码交流专区

更多推荐