feat: 补全终端交互逻辑.
This commit is contained in:
@@ -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('复制失败');
|
||||
|
||||
Reference in New Issue
Block a user