mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-28 05:42:51 +00:00
17 lines
386 B
TypeScript
17 lines
386 B
TypeScript
import Clipboard from 'vue-clipboard3'
|
|
import { MsgSuccess, MsgError } from '@/utils/message'
|
|
import { t } from '@/locales'
|
|
/*
|
|
复制粘贴
|
|
*/
|
|
export async function copyClick(info: string) {
|
|
const { toClipboard } = Clipboard()
|
|
try {
|
|
await toClipboard(info)
|
|
MsgSuccess(t('common.copySuccess'))
|
|
} catch (e) {
|
|
console.error(e)
|
|
MsgError(t('common.copyError'))
|
|
}
|
|
}
|