|
@@ -0,0 +1,89 @@
|
|
|
+<template>
|
|
|
+ <div id="aside-1">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-menu
|
|
|
+ :default-active="onRoutes"
|
|
|
+ unique-opened
|
|
|
+ router
|
|
|
+ :background-color="styleInfo.menus_bg_color"
|
|
|
+ :text-color="styleInfo.menus_txt_color"
|
|
|
+ :active-text-color="styleInfo.menus_actxt_color"
|
|
|
+ >
|
|
|
+ <template v-for="item in items">
|
|
|
+ <template v-if="item.type === '1'">
|
|
|
+ <el-submenu :index="item._id" :key="item._id">
|
|
|
+ <template slot="title">
|
|
|
+ <i :class="[item.icon]"></i>
|
|
|
+ <span slot="title">{{ item.name }}</span>
|
|
|
+ </template>
|
|
|
+ <template v-for="subItem in item.children">
|
|
|
+ <el-submenu v-if="subItem.children && subItem.children.length > 0" :index="subItem._id" :key="subItem._id">
|
|
|
+ <template slot="title">
|
|
|
+ <i :class="[subItem.icon]"></i>
|
|
|
+ <span slot="title">{{ subItem.name }}</span>
|
|
|
+ </template>
|
|
|
+ <el-menu-item v-for="(threeItem, i) in subItem.children" :key="i" :index="threeItem.path">
|
|
|
+ <template slot="title">
|
|
|
+ <i :class="[threeItem.icon]"></i>
|
|
|
+ <span slot="title">{{ threeItem.name }}</span>
|
|
|
+ </template>
|
|
|
+ </el-menu-item>
|
|
|
+ </el-submenu>
|
|
|
+ <el-menu-item v-else :index="subItem.path" :key="subItem.path">
|
|
|
+ <template slot="title">
|
|
|
+ <i :class="[subItem.icon]"></i>
|
|
|
+ <span slot="title">{{ subItem.name }}</span>
|
|
|
+ </template>
|
|
|
+ </el-menu-item>
|
|
|
+ </template>
|
|
|
+ </el-submenu>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-menu-item :index="item.path" :key="item.path">
|
|
|
+ <i :class="[item.icon]"></i>
|
|
|
+ <span slot="title">{{ item.name }}</span>
|
|
|
+ </el-menu-item>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </el-menu>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { menus, admin_style_one } from '../../../layout/site';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+export default {
|
|
|
+ name: 'aside-1',
|
|
|
+ props: {},
|
|
|
+ components: {},
|
|
|
+ data: function () {
|
|
|
+ return {
|
|
|
+ items: menus,
|
|
|
+ styleInfo: admin_style_one,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ methods: {},
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ onRoutes() {
|
|
|
+ return this.$route.path;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ test: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|