Browse Source

修复复制存档失败BUG

master
许孟阳 1 week ago
parent
commit
2b0f5bc7c7
  1. 13
      src/views/archive.vue

13
src/views/archive.vue

@ -47,12 +47,23 @@ const showMenu = () => { @@ -47,12 +47,23 @@ const showMenu = () => {
}
const copyArchive = () => {
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(archive.value).then(() => {
commit('set_sys_info', { msg: t('copyArchive.1'), type: 'win' })
}, () => {
showMenu();
}).catch(() => {
commit('set_sys_info', { msg: t('copyArchive.2'), type: 'waring' })
});
} else {
const textField = document.createElement("textarea");
textField.innerText = archive.value;
document.body.appendChild(textField);
textField.select();
document.execCommand("copy");
textField.remove();
commit('set_sys_info', { msg: t('copyArchive.1'), type: 'win' })
showMenu();
}
}
const pasteArchive = () => {

Loading…
Cancel
Save