Skip to content

Commit 3e8c5f1

Browse files
authored
Update utils.js
1 parent f693d38 commit 3e8c5f1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

utils.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,18 @@ let onNextFrame = (callback) => {
217217
}
218218

219219

220+
// copy
221+
let copy = (text) => {
222+
const textArea = document.createElement("textarea");
223+
textArea.value = text;
224+
document.body.appendChild(textArea);
225+
textArea.focus();
226+
textArea.select();
227+
document.execCommand('copy');
228+
document.body.removeChild(textArea);
229+
}
230+
231+
220232
// HTTP Request
221233
let axios = {
222234
'get': (url, token) => {

0 commit comments

Comments
 (0)