From da76b81ea4195d857642d9ef922b3715cdbff8cf Mon Sep 17 00:00:00 2001 From: gerson <1405270578@qq.com> Date: 星期二, 21 一月 2025 16:47:46 +0800 Subject: [PATCH] closeSyncMsg --- src/components/chat/components/playBar/PlayBar.vue | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/chat/components/playBar/PlayBar.vue b/src/components/chat/components/playBar/PlayBar.vue index a37b1f7..01002bd 100644 --- a/src/components/chat/components/playBar/PlayBar.vue +++ b/src/components/chat/components/playBar/PlayBar.vue @@ -1,6 +1,6 @@ <template> <div class="flex flex-col w-full gap-2"> - <div class="relative sync-msg-tip" v-show="showSyncMsg"> + <div class="relative sync-msg-tip" v-show="showSyncMsg" @click="closeSyncMsg"> <div class="absolute flex-center w-full text-black opacity-75 bottom-0.5"> <div class="w-fit bg-gray-300 p-2 rounded-md shadow-lg"> <div class="font-bold mb-2">{{ syncMsgContent.title }}</div> @@ -163,16 +163,19 @@ syncMsgContent.value.title = ''; syncMsgContent.value.content = ''; }; +const closeSyncMsg = () => { + showSyncMsg.value = false; + nextTick(() => { + resetSyncMsg(); + }); +}; const showSyncTip = (data) => { showSyncMsg.value = true; syncMsgContent.value.title = `鏉ヨ嚜锛�${data?.from || '鏈煡绔�'}娑堟伅`; const question = data?.question ? `鈥�${data?.question}鈥漙 : '鏂扮殑'; syncMsgContent.value.content = `姝e湪澶勭悊${question}鎻愰棶锛岃姹傜瓑寰咃紒`; setTimeout(() => { - showSyncMsg.value = false; - nextTick(() => { - resetSyncMsg(); - }); + closeSyncMsg(); }, syncMsgDuration); }; defineExpose({ addPhrase, showSyncTip }); -- Gitblit v1.9.3