update notice

This commit is contained in:
不做码农 2022-06-05 21:03:59 +08:00
parent d1cc6bf15f
commit b055189b45
2 changed files with 8 additions and 4 deletions

View File

@ -1,8 +1,8 @@
<template> <template>
<div> <div>
<el-popover placement="bottom" trigger="hover" width="400" popper-class="el-popover-pupop-user-news"> <el-popover placement="bottom" trigger="hover" width="300px" popper-class="el-popover-pupop-user-news">
<template #reference> <template #reference>
<el-badge :is-dot="newsDot" style="line-height: 18px"> <el-badge :is-dot="noticeDot" style="line-height: 18px">
<el-icon><bell /></el-icon> <el-icon><bell /></el-icon>
</el-badge> </el-badge>
</template> </template>
@ -35,15 +35,18 @@
<script setup name="noticeIndex"> <script setup name="noticeIndex">
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// //
const newsDot = ref(true) const newsDot = ref(false)
const noticeList = computed(() => { const noticeList = computed(() => {
return proxy.$store.getters.noticeList return proxy.$store.getters.noticeList
}) })
const noticeDot = computed(() => {
return proxy.$store.getters.noticeDot
})
// //
function onAllReadClick() { function onAllReadClick() {
newsDot.value = false newsDot.value = false
proxy.$modal.msg('敬请期待') proxy.$modal.msg('请自行实现')
} }
// //
function onGoToGiteeClick() { function onGoToGiteeClick() {

View File

@ -19,6 +19,7 @@ const getters = {
sidebarRouters: state => state.permission.sidebarRouters, sidebarRouters: state => state.permission.sidebarRouters,
onlineUserNum: state => state.socket.onlineNum, onlineUserNum: state => state.socket.onlineNum,
noticeList: state => state.socket.noticeList, noticeList: state => state.socket.noticeList,
noticeDot: state => state.socket.noticeList.length > 0,
onlineUsers: state => state.socket.onlineUsers onlineUsers: state => state.socket.onlineUsers
} }
export default getters export default getters