Commit 35c07fa1 by 王志慧

fixed

1 parent 8dd168e4
......@@ -305,7 +305,7 @@ export default {
// return `r${new Date().getTime()}d${Math.ceil(Math.random() * 1000)}`
},
setFocus() {
this.savedRange.setStartAfter(document.querySelector('.w-textarea_input').lastChild)
this.savedRange.setStartAfter && this.savedRange.setStartAfter(document.querySelector('.w-textarea_input').lastChild)
},
selectHandler() {
// 监听选定文本的变动
......
......@@ -157,6 +157,10 @@ export default {
}
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML = htm
const html = this.getTextValue(htm),
text = html.replace(/\[.+?\]/g, '').replace(/\${.+?}/g, '')
this.textNum = text.length
if(this.textNum == 200) this.limitContent = htm
this.$refs.textContent.setFocus()
}, 100)
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!