@@ -15,10 +15,6 @@ import { $t } from '#/locales';
1515import { resetRoutes } from ' #/router' ;
1616import { useAppStore } from ' #/store' ;
1717
18- // https://avatar.vercel.sh/vercel.svg?text=Vaa
19- // https://avatar.vercel.sh/1
20- // https://avatar.vercel.sh/nextjs
21- // https://avatar.vercel.sh/satori
2218const notifications = ref <NotificationItem []>([
2319 {
2420 avatar: ' https://avatar.vercel.sh/vercel.svg?text=VB' ,
@@ -50,6 +46,10 @@ const notifications = ref<NotificationItem[]>([
5046 },
5147]);
5248
49+ const showDot = computed (() =>
50+ notifications .value .some ((item ) => ! item .isRead ),
51+ );
52+
5353const menus = computed (() => [
5454 {
5555 handler : () => {
@@ -92,6 +92,10 @@ async function handleLogout() {
9292function handleNoticeClear() {
9393 notifications .value = [];
9494}
95+
96+ function handleMakeAll() {
97+ notifications .value .forEach ((item ) => (item .isRead = true ));
98+ }
9599 </script >
96100
97101<template >
@@ -108,9 +112,10 @@ function handleNoticeClear() {
108112 </template >
109113 <template #notification >
110114 <Notification
115+ :dot =" showDot"
111116 :notifications =" notifications"
112- dot
113117 @clear =" handleNoticeClear"
118+ @make-all =" handleMakeAll"
114119 />
115120 </template >
116121 </BasicLayout >
0 commit comments