Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 05e9d652
authored
Nov 12, 2025
by
shixi
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: for tdesign
1 parent
0bbb20fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
apps/web-tdesign/src/layouts/basic.vue
apps/web-tdesign/src/layouts/basic.vue
View file @
05e9d65
...
@@ -23,6 +23,7 @@ import LoginForm from '#/views/_core/authentication/login.vue';
...
@@ -23,6 +23,7 @@ import LoginForm from '#/views/_core/authentication/login.vue';
const
notifications
=
ref
<
NotificationItem
[]
>
([
const
notifications
=
ref
<
NotificationItem
[]
>
([
{
{
id
:
1
,
avatar
:
'https://avatar.vercel.sh/vercel.svg?text=VB'
,
avatar
:
'https://avatar.vercel.sh/vercel.svg?text=VB'
,
date
:
'3小时前'
,
date
:
'3小时前'
,
isRead
:
true
,
isRead
:
true
,
...
@@ -30,6 +31,7 @@ const notifications = ref<NotificationItem[]>([
...
@@ -30,6 +31,7 @@ const notifications = ref<NotificationItem[]>([
title
:
'收到了 14 份新周报'
,
title
:
'收到了 14 份新周报'
,
},
},
{
{
id
:
2
,
avatar
:
'https://avatar.vercel.sh/1'
,
avatar
:
'https://avatar.vercel.sh/1'
,
date
:
'刚刚'
,
date
:
'刚刚'
,
isRead
:
false
,
isRead
:
false
,
...
@@ -37,6 +39,7 @@ const notifications = ref<NotificationItem[]>([
...
@@ -37,6 +39,7 @@ const notifications = ref<NotificationItem[]>([
title
:
'朱偏右 回复了你'
,
title
:
'朱偏右 回复了你'
,
},
},
{
{
id
:
3
,
avatar
:
'https://avatar.vercel.sh/1'
,
avatar
:
'https://avatar.vercel.sh/1'
,
date
:
'2024-01-01'
,
date
:
'2024-01-01'
,
isRead
:
false
,
isRead
:
false
,
...
@@ -44,12 +47,31 @@ const notifications = ref<NotificationItem[]>([
...
@@ -44,12 +47,31 @@ const notifications = ref<NotificationItem[]>([
title
:
'曲丽丽 评论了你'
,
title
:
'曲丽丽 评论了你'
,
},
},
{
{
id
:
4
,
avatar
:
'https://avatar.vercel.sh/satori'
,
avatar
:
'https://avatar.vercel.sh/satori'
,
date
:
'1天前'
,
date
:
'1天前'
,
isRead
:
false
,
isRead
:
false
,
message
:
'描述信息描述信息描述信息'
,
message
:
'描述信息描述信息描述信息'
,
title
:
'代办提醒'
,
title
:
'代办提醒'
,
},
},
{
id
:
5
,
avatar
:
'https://avatar.vercel.sh/satori'
,
date
:
'1天前'
,
isRead
:
false
,
message
:
'描述信息描述信息描述信息'
,
title
:
'跳转Workspace示例'
,
link
:
'/workspace'
,
},
{
id
:
6
,
avatar
:
'https://avatar.vercel.sh/satori'
,
date
:
'1天前'
,
isRead
:
false
,
message
:
'描述信息描述信息描述信息'
,
title
:
'跳转外部链接示例'
,
link
:
'https://doc.vben.pro'
,
},
]);
]);
const
userStore
=
useUserStore
();
const
userStore
=
useUserStore
();
...
@@ -102,6 +124,17 @@ function handleNoticeClear() {
...
@@ -102,6 +124,17 @@ function handleNoticeClear() {
notifications
.
value
=
[];
notifications
.
value
=
[];
}
}
function
markRead
(
id
:
number
|
string
)
{
const
item
=
notifications
.
value
.
find
((
item
)
=>
item
.
id
===
id
);
if
(
item
)
{
item
.
isRead
=
true
;
}
}
function
remove
(
id
:
number
|
string
)
{
notifications
.
value
=
notifications
.
value
.
filter
((
item
)
=>
item
.
id
!==
id
);
}
function
handleMakeAll
()
{
function
handleMakeAll
()
{
notifications
.
value
.
forEach
((
item
)
=>
(
item
.
isRead
=
true
));
notifications
.
value
.
forEach
((
item
)
=>
(
item
.
isRead
=
true
));
}
}
...
@@ -144,6 +177,8 @@ watch(
...
@@ -144,6 +177,8 @@ watch(
:dot=
"showDot"
:dot=
"showDot"
:notifications=
"notifications"
:notifications=
"notifications"
@
clear=
"handleNoticeClear"
@
clear=
"handleNoticeClear"
@
read=
"(item) => item.id && markRead(item.id)"
@
remove=
"(item) => item.id && remove(item.id)"
@
make-all=
"handleMakeAll"
@
make-all=
"handleMakeAll"
/>
/>
</
template
>
</
template
>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment