添加复制时提示

This commit is contained in:
539943419 committed 2024-07-20 21:16:10 +08:00
1 parent cf4297cc3c
commit 1780a0bb8b
2 files changed
+14 -2

No files matched your search

+6 -1
View File
@@ -3,7 +3,7 @@
<n-flex style="padding-top: 10px;">
<n-input v-model:value="groupCode" type="text" placeholder="输入邀请码" style="flex:1">
<template #suffix>
<n-icon :component="CopyOutline" style="cursor: pointer;" @click='toClipboard(groupCode)' />
<n-icon :component="CopyOutline" style="cursor: pointer;" @click='_toClipboard(groupCode)' />
</template>
</n-input>
<n-flex>
@@ -98,6 +98,11 @@ const message = useMessage()
// const modal = useModal();
const { toClipboard } = useClipboard();
const _toClipboard = async (text) => {
await toClipboard(text)
message.info(`已复制 ${text.length < 10 ? text : text.substring(0,7) + '...'}`)
}
const setting = useSettingStore();
const serverPort = setting.serverPort;
const wsBaseUrl = 'ws' + "://" + location.hostname + ":" + serverPort;