1***@qq.com
1***@qq.com
  • 发布:2023-09-09 16:11
  • 更新:2023-09-09 16:11
  • 阅读:166

nvue 在安卓上 areatext怎么选择光标

分类:nvue

我这个有个功能就是在文字里插入表情

inputEmoji(item) {  
    this.$refs.input.getSelectionRange(res => {  
    this.selectStart = res.selectionStart  
    this.selectEnd = res.selectionEnd  
    this.text = this.text.slice(0,this.selectStart) + item.text + this.text.slice(this.selectEnd)  
    this.selectStart += item.text.length  
    this.selectEnd += item.text.length  
})

但是插完光标直接跳到了最后面,怎么才能让光标保持在原地,我想着是改完再跳光标,但是this.$refs.input.setSelectionRange()没有

2023-09-09 16:11 负责人:无 分享
已邀请:

要回复问题请先登录注册