This commit is contained in:
‘937886381’
2026-01-12 16:07:02 +08:00
parent b491f24126
commit babbe98c09
95 changed files with 286 additions and 259 deletions

View File

@@ -17,7 +17,7 @@ export default {
const vnodes = []
if (icon) {
vnodes.push(<svg-icon icon-class={icon}/>)
vnodes.push(<svg-icon icon-class={icon} />)
}
if (title) {

View File

@@ -1,19 +1,12 @@
<template>
<div :class="{ 'has-logo': showLogo }" :style="{
backgroundColor:
settings.sideTheme === 'theme-dark'
? variables.menuBackground
: variables.menuLightBackground,
}">
<div :class="{ 'has-logo': showLogo }"
:style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
<el-menu :default-active="activeMenu" :collapse="isCollapse" :background-color="settings.sideTheme === 'theme-dark'
? variables.menuBackground
: variables.menuLightBackground
" :text-color="settings.sideTheme === 'theme-dark'
? variables.menuColor
: variables.menuLightColor
" :unique-opened="true" active-text-color="#fff" :collapse-transition="false" mode="vertical">
<el-menu :default-active="activeMenu" :collapse="isCollapse"
:background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
:text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
:unique-opened="true" :active-text-color="settings.theme" :collapse-transition="false" mode="vertical">
<!-- 根据 sidebarRouters 路由生成菜单 -->
<sidebar-item v-for="(route, index) in sidebarRouters" :key="route.path + index" :item="route"
:base-path="route.path" />
@@ -23,16 +16,16 @@
</template>
<script>
import { mapGetters, mapState } from 'vuex';
import Logo from './Logo';
import SidebarItem from './SidebarItem';
import variables from '@/assets/styles/variables.scss';
import { mapGetters, mapState } from "vuex";
import Logo from "./Logo";
import SidebarItem from "./SidebarItem";
import variables from "@/assets/styles/variables.scss";
export default {
components: { SidebarItem, Logo },
computed: {
...mapState(['settings']),
...mapGetters(['sidebarRouters', 'sidebar']),
...mapState(["settings"]),
...mapGetters(["sidebarRouters", "sidebar"]),
activeMenu() {
const route = this.$route;
const { meta, path } = route;
@@ -50,7 +43,7 @@ export default {
},
isCollapse() {
return !this.sidebar.opened;
},
},
}
}
};
</script>