移除多个空格

This commit is contained in:
lyswhut
2020-02-10 18:12:38 +08:00
parent a9e3723764
commit 5bff74e7a9
3 changed files with 4 additions and 4 deletions
@@ -119,6 +119,7 @@ export default {
let str = clipboardReadText()
str = str.trim()
str = str.replace(/\t|\r\n|\n|\r/g, ' ')
str = str.replace(/\s+/g, ' ')
let dom_input = this.$refs.dom_input
this.text = `${this.text.substring(0, dom_input.selectionStart)}${str}${this.text.substring(dom_input.selectionEnd, this.text.length)}`
this.$emit('input', this.text)