Blame view

src/layout/components/Sidebar/sidebarRight.vue 1.42 KB
xiaomiao committed
1 2 3
<!--
 * @Author: xiaomiao 1158771342@qq.com
 * @Date: 2023-01-10 09:03:06
任超 committed
4
 * @LastEditors: Please set LastEditors
任超 committed
5
 * @LastEditTime: 2023-03-23 16:29:24
xiaomiao committed
6 7 8
 * @FilePath: \监管系统\js-web-jianguan\src\layout\components\Sidebar\sidebarRight.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
任超 committed
9
<template>
任超 committed
10 11
  <el-menu router :default-active="activeMenu" mode="horizontal">
    <!-- 权限菜单 -->
任超 committed
12
    <sidebar-item v-for="route in permission_routes.slice(7, 10)" :key="route.path" :item="route"
任超 committed
13
      :base-path="route.path" />
任超 committed
14
    <!-- 菜单全部展示 -->
任超 committed
15
    <!-- <sidebar-item v-for="route in asyncRoutes" :key="route.path" :item="route" :base-path="route.path" /> -->
任超 committed
16
  </el-menu>
任超 committed
17 18 19
</template>

<script>
任超 committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33
import { mapGetters } from 'vuex'
import Logo from './Logo'
import SidebarItem from './SidebarItem'
import variables from '@/styles/variables.scss'
import { asyncRoutes } from '@/router'
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
任超 committed
34
      }
任超 committed
35 36 37 38 39 40 41
      return path
    },
    variables () {
      return variables
    },
    asyncRoutes () {
      return asyncRoutes.slice(3, 6)
任超 committed
42 43
    }
  }
任超 committed
44
}
任超 committed
45
</script>