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


posted on 2020-03-12 09:59  程序猿-alvin  阅读(1965)  评论(0编辑  收藏  举报

导航