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

feat: 添加消息通知图标隐藏功能

This commit is contained in:
pany 2022-10-31 15:35:51 +08:00
parent d8f47cf91e
commit 4e2ffa38f5
4 changed files with 13 additions and 2 deletions

View File

@ -8,6 +8,8 @@ interface ILayoutSettings {
showSidebarLogo: boolean
/** 是否固定 Header */
fixedHeader: boolean
/** 是否显示消息通知 */
showNotify: boolean
/** 是否显示切换主题按钮 */
showThemeSwitch: boolean
/** 是否显示全屏按钮 */
@ -19,6 +21,7 @@ const layoutSettings: ILayoutSettings = {
showTagsView: true,
fixedHeader: true,
showSidebarLogo: true,
showNotify: true,
showThemeSwitch: true,
showScreenfull: true
}

View File

@ -19,6 +19,9 @@ const userStore = useUserStore()
const sidebar = computed(() => {
return appStore.sidebar
})
const showNotify = computed(() => {
return settingsStore.showNotify
})
const showThemeSwitch = computed(() => {
return settingsStore.showThemeSwitch
})
@ -42,7 +45,7 @@ const logout = () => {
<div class="right-menu">
<Screenfull v-if="showScreenfull" class="right-menu-item" />
<ThemeSwitch v-if="showThemeSwitch" class="right-menu-item" />
<Notify class="right-menu-item" />
<Notify v-if="showNotify" class="right-menu-item" />
<el-dropdown class="right-menu-item">
<el-avatar :icon="UserFilled" :size="34" />
<template #dropdown>

View File

@ -20,6 +20,10 @@ const settingsStore = useSettingsStore()
<span>固定 Header</span>
<el-switch v-model="settingsStore.fixedHeader" class="drawer-switch" />
</div>
<div class="drawer-item">
<span>显示消息通知</span>
<el-switch v-model="settingsStore.showNotify" class="drawer-switch" />
</div>
<div class="drawer-item">
<span>显示切换主题按钮</span>
<el-switch v-model="settingsStore.showThemeSwitch" class="drawer-switch" />

View File

@ -7,8 +7,9 @@ export const useSettingsStore = defineStore("settings", () => {
const showSettings = ref<boolean>(layoutSettings.showSettings)
const showTagsView = ref<boolean>(layoutSettings.showTagsView)
const showSidebarLogo = ref<boolean>(layoutSettings.showSidebarLogo)
const showNotify = ref<boolean>(layoutSettings.showNotify)
const showThemeSwitch = ref<boolean>(layoutSettings.showThemeSwitch)
const showScreenfull = ref<boolean>(layoutSettings.showScreenfull)
return { fixedHeader, showSettings, showTagsView, showSidebarLogo, showThemeSwitch, showScreenfull }
return { fixedHeader, showSettings, showTagsView, showSidebarLogo, showNotify, showThemeSwitch, showScreenfull }
})