使用vue-quill-editor时验证必填遇到的问题

2021-07-14  本文已影响0人  萬wan事顺意

问题:
我没有填内容在提交表单时会弹出提示必填的文字,然后我在文本框中填写内容,按照预期内容已不为空,必填提示文字应该消失.但是提示文字却没有消失,依然显示必填

解决:
添加change事件

<el-form
                :model="myForm"
                :rules="rules"
                class="max-height"
                ref="form"
              >
<quill-editor
                      class="appwrapper"
                      v-model="myForm.content"
                      ref="myQuillEditor"
                      :options="editorOption"
                      @blur="onEditorBlur($event)"
                      @focus="onEditorFocus($event)"
                      @change="onEditorChange($event)"
                    >
                    </quill-editor>

</el-form>


onEditorChange() {
      this.$refs['form'].validateField('content');
    }, // 内容改变事件

上一篇 下一篇

猜你喜欢

热点阅读