安裝 cnpm install vue2-editor --save
組件內使用 import {VueEditor} from 'vue2-editor'
<vue-editor ref="editor" v-model="contractDetail" />
說明 v-model 綁定的值
兩個常用用法:
一、獲取光標位置
this.$refs.editor.quill.selection.savedRange.index
二、在光標位置處插入字符串或者其它數據類型
this.$refs.editor.quill.insertText(this.$refs.editor.quill.selection.savedRange.index, ‘插入的內容’)