1.

<quillEditor 
    v-model="form.info"
    style="height:200px"
    ref="myQuillEditor"
    @change="onEditorChange($event)"
    :options="editorOption">
 </quillEditor>
 <div style="text-align:right;margin-right:10px;margin-bottom:-5px">
     {{TiLength}}/2000
  </div>

2.data里面:

 

3. mounted里面

 mounted(){
    //数据初始化
    this.TiLength =this.$refs.myQuillEditor.quill.getLength() - 1
  },

 4.methods里面

 methods:{
      onEditorChange(event) {
      event.quill.deleteText(2000,1);
      if(this.form.info===''){
        this.TiLength = 0
      }
      else{
        this.TiLength = event.quill.getLength()-1
      }
    },

Logo

前往低代码交流专区

更多推荐