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: {
|
||||
rawhtml(value) {
|
||||
if (typeof this.format === 'function') {
|
||||
return this.format(value);
|
||||
return this.format(value.replace(/ /g, ' '));
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ export default {
|
|||
this.selection.direction = sel.direction;
|
||||
this.selection.type = sel.type;
|
||||
}
|
||||
this.$emit('input', event.target.innerText);
|
||||
this.$emit('input', event.target.innerText.replace(/ /g, ' '));
|
||||
},
|
||||
calculateOffset(container, node, offset) {
|
||||
let position = 0;
|
||||
|
@ -91,8 +91,6 @@ export default {
|
|||
watch: {
|
||||
value() {
|
||||
if (this.selection) {
|
||||
console.log(this.selection);
|
||||
|
||||
const div = this.$refs.text;
|
||||
div.innerHTML = this.rawhtml(this.value);
|
||||
|
||||
|
@ -103,8 +101,6 @@ export default {
|
|||
|
||||
sel.removeAllRanges();
|
||||
sel.addRange(range);
|
||||
console.log(range, sel);
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue