添加复制时提示
This commit is contained in:
1 parent
cf4297cc3c
commit
1780a0bb8b
2 files changed
+14
-2
No files matched your search
@@ -6,7 +6,7 @@
|
|||||||
<div class="message-title">{{ `${msg.from.split('-')[0]} ${msg.timestampString}` }}</div>
|
<div class="message-title">{{ `${msg.from.split('-')[0]} ${msg.timestampString}` }}</div>
|
||||||
<div class="message-text" v-if="msg.type1 === 'text'">
|
<div class="message-text" v-if="msg.type1 === 'text'">
|
||||||
<span>{{ msg.msg }}</span>
|
<span>{{ msg.msg }}</span>
|
||||||
<n-icon :component="CopyOutline" class="message-text-copy" @click='toClipboard(msg.msg)' />
|
<n-icon :component="CopyOutline" class="message-text-copy" @click='_toClipboard(msg.msg)' />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="msg.type1 === 'img'">
|
<div v-if="msg.type1 === 'img'">
|
||||||
<span>
|
<span>
|
||||||
@@ -59,8 +59,15 @@ import { decrypt, decryptString, downloadFromUint8Array } from '../func/download
|
|||||||
import { CubeOutline as DownloadIcon, CopyOutline } from '@vicons/ionicons5'
|
import { CubeOutline as DownloadIcon, CopyOutline } from '@vicons/ionicons5'
|
||||||
import fileSize2String from '@/func/fileSize2String'
|
import fileSize2String from '@/func/fileSize2String'
|
||||||
import useClipboard from "vue-clipboard3";
|
import useClipboard from "vue-clipboard3";
|
||||||
|
import { useMessage } from "naive-ui";
|
||||||
|
|
||||||
|
const message = useMessage()
|
||||||
const { toClipboard } = useClipboard();
|
const { toClipboard } = useClipboard();
|
||||||
|
|
||||||
|
const _toClipboard = async (text) => {
|
||||||
|
await toClipboard(text)
|
||||||
|
message.info(`已复制 ${text.length < 10 ? text : text.substring(0,7) + '...'}`)
|
||||||
|
}
|
||||||
const setting = useSettingStore();
|
const setting = useSettingStore();
|
||||||
const serverPort = setting.serverPort;
|
const serverPort = setting.serverPort;
|
||||||
const baseUrl = location.protocol + "//" + location.hostname + ":" + serverPort + "/";
|
const baseUrl = location.protocol + "//" + location.hostname + ":" + serverPort + "/";
|
||||||
|
|||||||
+6
-1
@@ -3,7 +3,7 @@
|
|||||||
<n-flex style="padding-top: 10px;">
|
<n-flex style="padding-top: 10px;">
|
||||||
<n-input v-model:value="groupCode" type="text" placeholder="输入邀请码" style="flex:1">
|
<n-input v-model:value="groupCode" type="text" placeholder="输入邀请码" style="flex:1">
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<n-icon :component="CopyOutline" style="cursor: pointer;" @click='toClipboard(groupCode)' />
|
<n-icon :component="CopyOutline" style="cursor: pointer;" @click='_toClipboard(groupCode)' />
|
||||||
</template>
|
</template>
|
||||||
</n-input>
|
</n-input>
|
||||||
<n-flex>
|
<n-flex>
|
||||||
@@ -98,6 +98,11 @@ const message = useMessage()
|
|||||||
// const modal = useModal();
|
// const modal = useModal();
|
||||||
const { toClipboard } = useClipboard();
|
const { toClipboard } = useClipboard();
|
||||||
|
|
||||||
|
const _toClipboard = async (text) => {
|
||||||
|
await toClipboard(text)
|
||||||
|
message.info(`已复制 ${text.length < 10 ? text : text.substring(0,7) + '...'}`)
|
||||||
|
}
|
||||||
|
|
||||||
const setting = useSettingStore();
|
const setting = useSettingStore();
|
||||||
const serverPort = setting.serverPort;
|
const serverPort = setting.serverPort;
|
||||||
const wsBaseUrl = 'ws' + "://" + location.hostname + ":" + serverPort;
|
const wsBaseUrl = 'ws' + "://" + location.hostname + ":" + serverPort;
|
||||||
|
|||||||
Reference in new issue
Block a user