perf(layout): 优化消息通知小红点显示逻辑 (#1265)

This commit is contained in:
Yorlg
2026-02-03 19:00:23 +08:00
committed by GitHub
parent 3ce26d614d
commit 986e6e5104

View File

@@ -24,6 +24,12 @@ const currentNoticeHasData = computed(() => {
return currentNotice && currentNotice.list.length > 0;
});
const hasAnyNoticeData = computed(() => {
return notices.value.some(
item => Array.isArray(item.list) && item.list.length > 0
);
});
const onWatchMore = () => {
dropdownRef.value.handleClose();
};
@@ -43,7 +49,7 @@ const onMarkAsRead = () => {
<span
:class="['dropdown-badge', 'navbar-bg-hover', 'select-none', 'mr-[7px]']"
>
<el-badge is-dot>
<el-badge is-dot :hidden="!hasAnyNoticeData">
<span class="header-notice-icon">
<IconifyIconOffline :icon="BellIcon" />
</span>