Vue中div contenteditable 的光標定位

在Vue作項目時,作了一個div[contenteditable=true]的組件做爲文本輸入框javascript 在非手動輸入值後,光標會丟失,經測試如下這段代碼可用,直接將光標定位到最後vue function keepLastIndex(obj) { console.log(obj) console.log(window.getSelection)
相關文章
相關標籤/搜索