stash
This commit is contained in:
parent
7eb6073c3c
commit
3a2a6328b0
1 changed files with 5 additions and 2 deletions
|
@ -90,12 +90,15 @@ export default {
|
||||||
value() {
|
value() {
|
||||||
if (this.selection) {
|
if (this.selection) {
|
||||||
const div = this.$refs.text;
|
const div = this.$refs.text;
|
||||||
|
const sel = window.getSelection();
|
||||||
|
sel.removeAllRanges();
|
||||||
const range = document.createRange();
|
const range = document.createRange();
|
||||||
console.log(this.selection);
|
console.log(this.selection);
|
||||||
range.setStart(...this.findNode(div, this.selection.start));
|
range.setStart(...this.findNode(div, this.selection.start));
|
||||||
range.setEnd(...this.findNode(div, this.selection.end));
|
range.setEnd(...this.findNode(div, this.selection.end));
|
||||||
this.selection.removeAllRanges();
|
sel.addRange(range);
|
||||||
this.selection.addRange(range);
|
//this.selection.removeAllRanges();
|
||||||
|
//this.selection.addRange(range);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue