From a05d637bd27c00d5e5876e1afb05ea12377f70ff Mon Sep 17 00:00:00 2001 From: Phoenix <64720302+Concur-max@users.noreply.github.com> Date: Mon, 7 Jul 2025 09:43:43 +0800 Subject: [PATCH] =?UTF-8?q?style(=E7=BC=96=E8=BE=91=E5=99=A8):=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=8F=90=E5=8F=8A=E6=A0=B7=E5=BC=8F=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E5=92=8C=E8=83=8C=E6=99=AF=E4=BB=A5=E9=80=82=E9=85=8D=E6=B7=B1?= =?UTF-8?q?=E8=89=B2=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 统一编辑器与消息组件中的提及样式,使用主题变量并增加内边距 --- src/components/editor/TiptapEditor.vue | 6 +++--- src/components/talk/message/TextMessage.vue | 2 +- src/utils/strings.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/editor/TiptapEditor.vue b/src/components/editor/TiptapEditor.vue index 910ae5b..7b757d7 100644 --- a/src/components/editor/TiptapEditor.vue +++ b/src/components/editor/TiptapEditor.vue @@ -1058,10 +1058,10 @@ html[theme-mode='dark'] { /* 提及样式 */ .mention { - color: #0366d6; - background-color: rgba(3, 102, 214, 0.1); + color: #fff; + background-color: var(--im-primary-color); border-radius: 2px; - padding: 0 2px; + padding: 0 5px; } /* 引用卡片样式 */ diff --git a/src/components/talk/message/TextMessage.vue b/src/components/talk/message/TextMessage.vue index 68087dc..eba6792 100644 --- a/src/components/talk/message/TextMessage.vue +++ b/src/components/talk/message/TextMessage.vue @@ -17,7 +17,7 @@ let textContent = props.extra?.content || '' textContent = textReplaceLink(textContent) if (props.data.talk_type == 2) { - textContent = textReplaceMention(textContent, float==='right'?'#fff':'#462AA0') + textContent = textReplaceMention(textContent, float==='right'?'#462AA0':'#fff',float==='right'?'#fff':'#462AA0') } textContent = textReplaceEmoji(textContent) diff --git a/src/utils/strings.js b/src/utils/strings.js index bba4767..9e0a9b5 100644 --- a/src/utils/strings.js +++ b/src/utils/strings.js @@ -42,9 +42,9 @@ export function textReplaceLink(text, color = '#409eff') { * @param {String} text 文本 * @param {String} color 超链接颜色 */ -export function textReplaceMention(text, color = '#2196F3') { +export function textReplaceMention(text, color = '#2196F3',bg) { return text.replace(new RegExp(/@\S+/, 'g'), ($0, $1) => { - return `${$0}` + return `${$0}` }) }