Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-20 19:09:21 +08:00

perf: 代码优化 components/Notify

This commit is contained in:
pany 2023-05-22 09:14:03 +08:00
parent 2a79acc59a
commit 9c7fd02fb7

View File

@ -15,11 +15,7 @@ interface DataItem {
/** 角标当前值 */
const badgeValue = computed(() => {
let value = 0
for (let i = 0; i < data.value.length; i++) {
value += data.value[i].list.length
}
return value
return data.value.reduce((sum, item) => sum + item.list.length, 0)
})
/** 角标最大值 */
const badgeMax = 99