From d177cc8f5ee01d32932d1137920883209ec24be4 Mon Sep 17 00:00:00 2001 From: break-wave <654896146@qq.com> Date: Sat, 19 Dec 2020 14:47:37 +0800 Subject: [PATCH] fix: copy --- src/controllers/selection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/selection.js b/src/controllers/selection.js index c01dca3..0a04fe6 100644 --- a/src/controllers/selection.js +++ b/src/controllers/selection.js @@ -530,7 +530,7 @@ const selection = { oInput.setAttribute('readonly', 'readonly'); oInput.value = cpdata; document.body.appendChild(oInput); - oInput.setSelectionRange(0, cpdata.length); + oInput.select(); // 选择对象 document.execCommand("Copy"); oInput.style.display='none'; document.body.removeChild(oInput);