vue2-editor 使用和说明

安装  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, ‘插入的内容’)


猜你喜欢

转载自www.cnblogs.com/alvin553819/p/12467323.html