美文网首页
使用vue-quill-editor时验证必填遇到的问题

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

作者: 萬wan事顺意 | 来源:发表于2021-07-14 17:37 被阅读0次

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

解决:
添加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');
    }, // 内容改变事件

相关文章

网友评论

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

      本文链接:https://www.haomeiwen.com/subject/xinypltx.html