feat: 增加复制路径功能 (#749)

Co-authored-by: blank <admin@zym88.cn>
pull/775/head
你的明明呐丶 2 years ago committed by GitHub
parent 9435290bb6
commit bfd857ec4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -789,6 +789,7 @@ const message = {
theme: 'Theme',
language: 'Language',
eol: 'End Of Line',
copyDir: 'Copy Dir',
},
setting: {
all: 'All',

@ -796,6 +796,7 @@ const message = {
theme: '',
language: '',
eol: '',
copyDir: '',
},
setting: {
all: '',

@ -297,6 +297,18 @@ const open = async (row: File.File) => {
}
};
const copyDir = (row: File.File) => {
if (row?.path) {
const input = document.createElement('textarea');
input.value = row?.path;
document.body.appendChild(input);
input.select();
document.execCommand('copy');
document.body.removeChild(input);
MsgSuccess('复制成功');
}
};
const handlePath = () => {
if (breadCrumbRef.value.offsetWidth > pathWidth.value) {
paths.value.splice(0, 1);
@ -549,6 +561,10 @@ const buttons = [
label: i18n.global.t('file.open'),
click: open,
},
{
label: i18n.global.t('file.copyDir'),
click: copyDir,
},
{
label: i18n.global.t('file.mode'),
click: openMode,

Loading…
Cancel
Save