![控制可编辑的Div 在添加图片,或者@某人的时候 光标移动到最后 控制可编辑的Div 在添加图片,或者@某人的时候 光标移动到最后](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
this.$refs.editor.innerHTML += '<span style="color:yellowgreen;">@ 野猪佩奇</span><span> </span>'
var sel = window.getSelection()
var range = document.createRange()
range.selectNodeContents(this.$refs.editor)
range.collapse(false)
sel.removeAllRanges()
sel.addRange(range)