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

perf: 代码优化 layout/NavigationBar

This commit is contained in:
pany 2023-06-14 18:14:11 +08:00
parent 710ff1cda7
commit 9083700b3d

View File

@ -1,6 +1,6 @@
<script lang="ts" setup>
import { computed } from "vue"
import { useRouter } from "vue-router"
import { storeToRefs } from "pinia"
import { useAppStore } from "@/store/modules/app"
import { useSettingsStore } from "@/store/modules/settings"
import { useUserStore } from "@/store/modules/user"
@ -16,22 +16,14 @@ const appStore = useAppStore()
const settingsStore = useSettingsStore()
const userStore = useUserStore()
const sidebar = computed(() => {
return appStore.sidebar
})
const showNotify = computed(() => {
return settingsStore.showNotify
})
const showThemeSwitch = computed(() => {
return settingsStore.showThemeSwitch
})
const showScreenfull = computed(() => {
return settingsStore.showScreenfull
})
const { sidebar } = storeToRefs(appStore)
const { showNotify, showThemeSwitch, showScreenfull } = storeToRefs(settingsStore)
/** 切换侧边栏 */
const toggleSidebar = () => {
appStore.toggleSidebar(false)
}
/** 登出 */
const logout = () => {
userStore.logout()
router.push("/login")
@ -87,7 +79,7 @@ const logout = () => {
}
.breadcrumb {
float: left;
// Bootstrap WIDTH = 576
// Bootstrap 576
@media screen and (max-width: 576px) {
display: none;
}