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' ...@@ -10,6 +10,7 @@ import OSS from 'ali-oss'
export default { export default {
components: {}, components: {},
emits: ['update:fileUrl', 'update:fileName', 'update:fileList', 'upSuccess', 'getPicUrl', 'loadingChange'],
props: { props: {
// 单文件上传时使用 // 单文件上传时使用
fileUrl: { fileUrl: {
......
...@@ -25,12 +25,13 @@ export default { ...@@ -25,12 +25,13 @@ export default {
type: String, type: String,
}, },
}, },
emits: ['change'],
watch: { watch: {
value(val) { value(val) {
this.content = val this.content = val
}, },
imgUrl(val) { imgUrl(val) {
let quill = this.$refs.quill.quill let quill = this.$refs.quill.getQuill()
let length = quill.getSelection().index //光标位置 let length = quill.getSelection().index //光标位置
// 插入图片 图片地址 // 插入图片 图片地址
quill.insertEmbed(length, 'image', val) quill.insertEmbed(length, 'image', val)
...@@ -96,11 +97,11 @@ export default { ...@@ -96,11 +97,11 @@ export default {
this.uploadLoading = percent > 0 && percent < 100 this.uploadLoading = percent > 0 && percent < 100
}, },
insertContent(emoji) { insertContent(emoji) {
let quill = this.$refs.quill let quill = this.$refs.quill.getQuill()
quill.focus() quill.focus()
let length = 0 //quill.getSelection().index //光标位置 let length = quill.getSelection().index //光标位置
quill.setHTML(length, emoji) quill.insertText(length, emoji)
// quill.setSelection(length + 2) //光标后移,表情占2位。所以+2 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!