Blame view

src/layout/components/Sidebar/sidebarRight.vue 1.51 KB
任超 committed
1
<template>
任超 committed
2 3
  <el-menu router :default-active="activeMenu" mode="horizontal">
    <!-- 权限菜单 -->
任超 committed
4
    <sidebar-item v-for="route in permission_routes.slice(4, 7)" :key="route.path" :item="route"
任超 committed
5
      :base-path="route.path" />
任超 committed
6
    <!-- 菜单全部展示 -->
任超 committed
7
    <!-- <sidebar-item v-for="route in asyncRoutes" :key="route.path" :item="route" :base-path="route.path" /> -->
任超 committed
8
  </el-menu>
任超 committed
9 10 11 12 13 14 15
</template>

<script>
import { mapGetters } from 'vuex'
import Logo from './Logo'
import SidebarItem from './SidebarItem'
import variables from '@/styles/variables.scss'
任超 committed
16
import { asyncRoutes } from '@/router'
任超 committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
export default {
  components: { SidebarItem, Logo },
  computed: {
    ...mapGetters(['permission_routes', 'sidebar']),
    activeMenu () {
      const route = this.$route
      const { meta, path } = route
      if (meta.activeMenu) {
        return meta.activeMenu
      }
      return path
    },
    variables () {
      return variables
    },
    asyncRoutes () {
任超 committed
33
      return asyncRoutes.slice(3, 6)
任超 committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
    }
  }
}
</script>
<style scoped lang="scss">
.el-menu--horizontal {
  display: flex;
  background: none !important;
}

/deep/.el-menu-item:hover {
  background: none;
  font-weight: 700;
  color: #fff !important;
}

/deep/.el-submenu__title {
  color: #fff;
  font-size: 18px;
}

/deep/.el-submenu__title:hover {
  background: none;
  font-weight: 700;
任超 committed
58
  font-size: 20px;
任超 committed
59 60 61 62 63
}

/deep/.el-menu--horizontal .el-menu-item:not(.is-disabled):focus {
  background: none;
  color: #fff;
任超 committed
64
  font-size: 20px;
任超 committed
65 66 67
  font-weight: 700 !important;
}
</style>