Commit ca069d70 by ext.wangyuman1

Merge branch 'vue3-master' of https://e.coding.net/linkwechat/linkwechat-front/l…

…inkwechat into vue3-master
2 parents e2551b5f a8cb802b
......@@ -10,6 +10,7 @@ import OSS from 'ali-oss'
export default {
components: {},
emits: ['update:fileUrl', 'update:fileName', 'update:fileList', 'upSuccess', 'getPicUrl', 'loadingChange'],
props: {
// 单文件上传时使用
fileUrl: {
......
......@@ -25,12 +25,13 @@ export default {
type: String,
},
},
emits: ['change'],
watch: {
value(val) {
this.content = val
},
imgUrl(val) {
let quill = this.$refs.quill.quill
let quill = this.$refs.quill.getQuill()
let length = quill.getSelection().index //光标位置
// 插入图片 图片地址
quill.insertEmbed(length, 'image', val)
......@@ -96,11 +97,11 @@ export default {
this.uploadLoading = percent > 0 && percent < 100
},
insertContent(emoji) {
let quill = this.$refs.quill
let quill = this.$refs.quill.getQuill()
quill.focus()
let length = 0 //quill.getSelection().index //光标位置
quill.setHTML(length, emoji)
// quill.setSelection(length + 2) //光标后移,表情占2位。所以+2
let length = quill.getSelection().index //光标位置
quill.insertText(length, emoji)
quill.setSelection(length + 2) //光标后移,表情占2位。所以+2
},
},
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!