diff --git a/src/views/im/home/components/ContextMenu.vue b/src/views/im/home/components/ContextMenu.vue index b98c62ba6..f6d639041 100644 --- a/src/views/im/home/components/ContextMenu.vue +++ b/src/views/im/home/components/ContextMenu.vue @@ -15,15 +15,26 @@ class="fixed min-w-30 py-1 bg-[var(--el-bg-color-overlay)] rounded-md shadow-lg" :style="{ left: adjustedPosition.x + 'px', top: adjustedPosition.y + 'px' }" > -
- {{ item.name }} -
+ @@ -43,12 +54,14 @@ const contextMenu = computed(() => uiStore.contextMenu) * 计算菜单实际渲染坐标:靠近视口右 / 下边缘时回弹,避免菜单被裁剪 * * itemHeight / menuWidth 是和模板里 px-4 py-2 + text-13px / min-w-30 配套的实际尺寸; + * dividerHeight = 9px(my-1 上下各 4 + 1px border),仅非首项的 divided 计入; * menuHeight 额外加 8 是外层 py-1 的上下 padding 之和(4px × 2) */ const adjustedPosition = computed(() => { const items = contextMenu.value.items const itemHeight = 34 - const menuHeight = items.length * itemHeight + 8 + const dividerCount = items.filter((it, i) => it.divided && i > 0).length + const menuHeight = items.length * itemHeight + dividerCount * 9 + 8 const menuWidth = 120 let x = contextMenu.value.position.x let y = contextMenu.value.position.y diff --git a/src/views/im/home/pages/conversation/components/conversation/ConversationItem.vue b/src/views/im/home/pages/conversation/components/conversation/ConversationItem.vue index 6d88f3591..818096e5b 100644 --- a/src/views/im/home/pages/conversation/components/conversation/ConversationItem.vue +++ b/src/views/im/home/pages/conversation/components/conversation/ConversationItem.vue @@ -27,7 +27,6 @@ {{ conversation.name }} - {{ conversation.lastContent }} - - + - - - + /> @@ -73,9 +71,11 @@