Vue-quill-editor get cannot get cursor position

vue-quill-editor get cannot get cursor position

let quill = this.$refs.myQuillEditor.quill
/ / if the upload is successful
if (rets = "lyck" & & rets! = = null) {
/ if the upload is successful
/ / get the location of the cursor
let length = quill.getSelection () .index
/ / insert the image address returned by the server res.url
quill.insertEmbed (length," image", result)
/ / adjust the cursor to the last
quill.setSelection (length + 1)

let quill = this.$refs.myQuillEditor.quill the value of quill that failed to get an instance of a rich text component is undefined

Jan.17,2022
In the

project, the cursor position is mainly the index value in range
this.$refs.myQuillEditor.quill. selection.savedRange.index to get the cursor position


because the content area of your rich text editor has no content, and there is a quill.getSelection () function if there is content. Otherwise, the value of quill.getSelection () is undefined


the event of getting the cursor. You can write on button and try other elements.


how to upgrade the quill dependency of vue-quill-editor

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ebbe57-5d6a9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ebbe57-5d6a9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?