2020-12-31 11:47:52 +08:00
|
|
|
<template>
|
2021-01-05 18:11:13 +08:00
|
|
|
<el-aside :class="isCollapse ? 'layout-aside-width64' : 'layout-aside-width240'">
|
2020-12-31 11:47:52 +08:00
|
|
|
<el-scrollbar>
|
|
|
|
<Vertical :menuList="menuList" />
|
|
|
|
</el-scrollbar>
|
|
|
|
</el-aside>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vertical from "/@/views/layout/navMenu/vertical.vue";
|
2021-01-05 18:11:13 +08:00
|
|
|
import { toRefs, reactive, computed } from "vue";
|
|
|
|
import { useStore } from "/@/store/index.ts";
|
2020-12-31 11:47:52 +08:00
|
|
|
export default {
|
|
|
|
name: "layoutAside",
|
|
|
|
components: { Vertical },
|
|
|
|
setup() {
|
2021-01-05 18:11:13 +08:00
|
|
|
const store = useStore();
|
2020-12-31 11:47:52 +08:00
|
|
|
const state = reactive({
|
|
|
|
menuList: [
|
|
|
|
{
|
|
|
|
path: "/home",
|
|
|
|
meta: {
|
|
|
|
title: "首页",
|
|
|
|
icon: "el-icon-s-home",
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
2021-01-03 22:43:07 +08:00
|
|
|
path: "/home",
|
2020-12-31 11:47:52 +08:00
|
|
|
meta: {
|
2021-01-03 22:43:07 +08:00
|
|
|
title: "微软",
|
2020-12-31 11:47:52 +08:00
|
|
|
icon: "el-icon-s-flag",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-01-03 22:43:07 +08:00
|
|
|
path: "/docs",
|
2020-12-31 11:47:52 +08:00
|
|
|
meta: {
|
2021-01-03 22:43:07 +08:00
|
|
|
title: "文档",
|
2020-12-31 11:47:52 +08:00
|
|
|
icon: "el-icon-s-flag",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-01-03 22:43:07 +08:00
|
|
|
path: "/docs1",
|
2020-12-31 11:47:52 +08:00
|
|
|
meta: {
|
2021-01-03 22:43:07 +08:00
|
|
|
title: "文档1",
|
2020-12-31 11:47:52 +08:00
|
|
|
icon: "el-icon-s-flag",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2021-01-03 22:43:07 +08:00
|
|
|
path: "/docs2",
|
2020-12-31 11:47:52 +08:00
|
|
|
meta: {
|
2021-01-03 22:43:07 +08:00
|
|
|
title: "文档2",
|
2020-12-31 11:47:52 +08:00
|
|
|
icon: "el-icon-s-management",
|
|
|
|
isLink: "https://www.ele.me",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-01-03 22:43:07 +08:00
|
|
|
path: "/docs3",
|
2020-12-31 11:47:52 +08:00
|
|
|
meta: {
|
2021-01-03 22:43:07 +08:00
|
|
|
title: "文档3",
|
2020-12-31 11:47:52 +08:00
|
|
|
icon: "el-icon-s-management",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
});
|
2021-01-05 18:11:13 +08:00
|
|
|
const isCollapse = computed(() => {
|
|
|
|
return store.state.themeConfig.isCollapse;
|
|
|
|
});
|
2020-12-31 11:47:52 +08:00
|
|
|
return {
|
2021-01-05 18:11:13 +08:00
|
|
|
isCollapse,
|
2020-12-31 11:47:52 +08:00
|
|
|
...toRefs(state),
|
|
|
|
};
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|