stash
This commit is contained in:
parent
0bc12c95c0
commit
0b4c49c7f8
1 changed files with 2 additions and 6 deletions
|
@ -25,7 +25,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
rawhtml(value) {
|
rawhtml(value) {
|
||||||
if (typeof this.format === 'function') {
|
if (typeof this.format === 'function') {
|
||||||
return this.format(value);
|
return this.format(value.replace(/ /g, ' '));
|
||||||
} else {
|
} else {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ export default {
|
||||||
this.selection.direction = sel.direction;
|
this.selection.direction = sel.direction;
|
||||||
this.selection.type = sel.type;
|
this.selection.type = sel.type;
|
||||||
}
|
}
|
||||||
this.$emit('input', event.target.innerText);
|
this.$emit('input', event.target.innerText.replace(/ /g, ' '));
|
||||||
},
|
},
|
||||||
calculateOffset(container, node, offset) {
|
calculateOffset(container, node, offset) {
|
||||||
let position = 0;
|
let position = 0;
|
||||||
|
@ -91,8 +91,6 @@ export default {
|
||||||
watch: {
|
watch: {
|
||||||
value() {
|
value() {
|
||||||
if (this.selection) {
|
if (this.selection) {
|
||||||
console.log(this.selection);
|
|
||||||
|
|
||||||
const div = this.$refs.text;
|
const div = this.$refs.text;
|
||||||
div.innerHTML = this.rawhtml(this.value);
|
div.innerHTML = this.rawhtml(this.value);
|
||||||
|
|
||||||
|
@ -103,8 +101,6 @@ export default {
|
||||||
|
|
||||||
sel.removeAllRanges();
|
sel.removeAllRanges();
|
||||||
sel.addRange(range);
|
sel.addRange(range);
|
||||||
console.log(range, sel);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue