Commit e85f9c2d by 杨明

fixed

1 parent 09c47d8c
...@@ -64,8 +64,7 @@ export default { ...@@ -64,8 +64,7 @@ export default {
// 创建模版标签的style // 创建模版标签的style
this.createStyle() this.createStyle()
// 每次光标变化的时候,保存 range // 每次光标变化的时候,保存 range
document.querySelector('.w-textarea_input').addEventListener('keyup', this.selectHandler) document.addEventListener('selectionchange', this.selectHandler)
document.querySelector('.w-textarea_input').addEventListener('click', this.selectHandler)
}, },
beforeDestroy() { beforeDestroy() {
// 卸载事件 // 卸载事件
...@@ -312,7 +311,6 @@ export default { ...@@ -312,7 +311,6 @@ export default {
if (range && range.commonAncestorContainer.ownerDocument.activeElement.id === this.contentId) { if (range && range.commonAncestorContainer.ownerDocument.activeElement.id === this.contentId) {
this.savedRange = range this.savedRange = range
} }
console.log(this.savedRange)
} }
}, },
watch: { watch: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!