From 90fe9d45b0d73e31a11ffe7caf373c359a01b4aa Mon Sep 17 00:00:00 2001 From: JimQing Date: Sat, 4 Jul 2020 01:18:02 +0800 Subject: [PATCH] fix: remove select ranges --- src/components/codeMirror/header.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/codeMirror/header.vue b/src/components/codeMirror/header.vue index 0de5ab0..a240c03 100644 --- a/src/components/codeMirror/header.vue +++ b/src/components/codeMirror/header.vue @@ -187,8 +187,7 @@ export default { range.setEndAfter(clipboardDiv.lastChild); window.getSelection().addRange(range); document.execCommand('copy'); - range.setStartBefore(clipboardDiv.firstChild); - range.setEndAfter(clipboardDiv.firstChild); + window.getSelection().removeAllRanges() fixCodeWhiteSpace('normal'); // 输出提示 this.$notify({