|
1
|
<template>
|
vben
authored
|
2
3
|
<div :class="prefixCls">
<Popover title="" trigger="click" :overlayClassName="`${prefixCls}__overlay`">
|
vben
authored
|
4
|
<Badge :count="count" dot :numberStyle="numberStyle">
|
vben
authored
|
5
|
<BellOutlined />
|
|
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
</Badge>
<template #content>
<Tabs>
<template v-for="item in tabListData" :key="item.key">
<TabPane>
<template #tab>
{{ item.name }}
<span v-if="item.list.length !== 0">({{ item.list.length }})</span>
</template>
<NoticeList :list="item.list" />
</TabPane>
</template>
</Tabs>
</template>
</Popover>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { Popover, Tabs, Badge } from 'ant-design-vue';
import { BellOutlined } from '@ant-design/icons-vue';
import { tabListData } from './data';
import NoticeList from './NoticeList.vue';
|
vben
authored
|
29
|
import { useDesign } from '/@/hooks/web/useDesign';
|
|
30
31
32
33
|
export default defineComponent({
components: { Popover, BellOutlined, Tabs, TabPane: Tabs.TabPane, Badge, NoticeList },
setup() {
|
vben
authored
|
34
35
|
const { prefixCls } = useDesign('header-notify');
|
|
36
|
let count = 0;
|
vben
authored
|
37
|
|
|
38
39
40
41
42
|
for (let i = 0; i < tabListData.length; i++) {
count += tabListData[i].list.length;
}
return {
|
vben
authored
|
43
|
prefixCls,
|
|
44
45
46
47
48
49
50
|
tabListData,
count,
numberStyle: {},
};
},
});
</script>
|
vben
authored
|
51
|
<style lang="less">
|
vben
authored
|
52
53
|
@import (reference) '../../../../../design/index.less';
@prefix-cls: ~'@{namespace}-header-notify';
|
vben
authored
|
54
|
|
vben
authored
|
55
|
.@{prefix-cls} {
|
vben
authored
|
56
|
padding-top: 2px;
|
|
57
|
|
vben
authored
|
58
59
60
61
|
&__overlay {
max-width: 360px;
}
|
vben
authored
|
62
63
64
|
.ant-tabs-content {
width: 300px;
}
|
|
65
|
|
vben
authored
|
66
67
|
.ant-badge {
font-size: 18px;
|
|
68
|
|
vben
authored
|
69
70
71
72
73
74
75
|
.ant-badge-multiple-words {
padding: 0 4px;
}
svg {
width: 0.9em;
}
|
|
76
77
78
|
}
}
</style>
|