Skip to content

Commit

Permalink
Merge pull request HalseySpicy#418 from limuen/fix-copy
Browse files Browse the repository at this point in the history
fix: 🧩 修复复制指令在复制不被支持或者操作下仍提示显示成功的消息
  • Loading branch information
limuen authored Apr 24, 2024
2 parents 363c670 + e346c23 commit 41b3eed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/directives/modules/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ const copy: Directive = {
async function handleClick(this: any) {
try {
await navigator.clipboard.writeText(this.copyData);
ElMessage({
type: "success",
message: "复制成功"
});
} catch (err) {
console.error("复制操作不被支持或失败: ", err);
}
ElMessage({
type: "success",
message: "复制成功"
});
}

export default copy;

0 comments on commit 41b3eed

Please sign in to comment.