重构代码.

This commit is contained in:
lijiahangmax
2023-09-24 23:28:02 +08:00
parent 6fa57c616c
commit 024a8b4596
21 changed files with 48 additions and 38 deletions

View File

@@ -3,15 +3,15 @@ import { Message } from '@arco-design/web-vue';
export default function useCopy() {
const { isSupported, copy: c, text, copied } = useClipboard();
const copy = (value: string, tips = `${value} 已复制`) => {
return c(value)
.then(() => {
const copy = async (value: string, tips = `${ value } 已复制`) => {
try {
await c(value);
if (tips) {
Message.success(tips);
}
}).catch(() => {
} catch {
Message.error('复制失败');
});
}
};
return {
isSupported,