feat: 注册限流配置

feat: 页面加载动画
feat: md样式优化
feat: 移动端全屏覆盖
This commit is contained in:
archer
2023-03-04 13:30:20 +08:00
parent 0ecf576e4e
commit 2cc32d1806
28 changed files with 515 additions and 252 deletions

View File

@@ -8,19 +8,25 @@ export const useCopyData = () => {
const { toast } = useToast();
return {
copyData: (data: string, title: string = '复制成功') => {
const clipboardObj = navigator.clipboard;
clipboardObj
.writeText(data)
.then(() => {
toast({
title,
status: 'success',
duration: 1000
});
})
.catch((err) => {
console.log(err);
try {
const textarea = document.createElement('textarea');
textarea.value = data;
document.body.appendChild(textarea);
textarea.select();
document.execCommand('copy');
document.body.removeChild(textarea);
toast({
title,
status: 'success',
duration: 1000
});
} catch (error) {
console.log(error);
toast({
title: '复制失败',
status: 'error'
});
}
}
};
};