feat: 补全终端交互逻辑.

This commit is contained in:
lijiahangmax
2024-01-12 02:05:27 +08:00
parent 6c0ad50b4e
commit c1a046f30e
14 changed files with 150 additions and 52 deletions

View File

@@ -4,14 +4,14 @@ import { Message } from '@arco-design/web-vue';
export default function useCopy() {
const { copy: c } = useClipboard();
// 复制
const copy = async (value: string | undefined, tips = `${value} 已复制`) => {
const copy = async (value: string | undefined, tips: string | boolean = `${value} 已复制`) => {
try {
if (!value) {
return;
}
await c(value);
if (tips) {
Message.success(tips);
Message.success(tips as string);
}
} catch (e) {
Message.error('复制失败');