refactor: add legacy option for useClipboard hook to solve compatibility issues (#4114)

#### What type of PR is this?

/kind improvement
/area console
/milestone 2.7.x

#### What this PR does / why we need it:

Console 端部分使用了复制功能的页面,所使用的 useClipboard hook 添加 legacy 参数以解决部分浏览器的兼容问题。

#### Which issue(s) this PR fixes:

Fixes #4113 

#### Special notes for your reviewer:

1. 使用路由地址(192.168.x.x)访问 Halo。
2. 测试附件详情弹框的链接复制和概览页面中的复制功能是否正常。

#### Does this PR introduce a user-facing change?

```release-note
优化 Console 端部分页面复制功能的兼容性问题。
```
pull/4061/head
Ryan Wang 2023-06-26 21:28:08 +08:00 committed by GitHub
parent 27ef8d3bab
commit 34d0f9369b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -333,7 +333,7 @@ export function useAttachmentSelect(
export function useAttachmentPermalinkCopy(
attachment: Ref<Attachment | undefined>
) {
const { copy } = useClipboard();
const { copy } = useClipboard({ legacy: true });
const { t } = useI18n();
const mediaType = computed(() => {

View File

@ -74,7 +74,7 @@ onMounted(() => {
});
// copy system information to clipboard
const { copy, isSupported } = useClipboard();
const { copy, isSupported } = useClipboard({ legacy: true });
const handleCopy = () => {
if (!isSupported.value) {