|
@@ -2,26 +2,30 @@
|
|
<div id="aside">
|
|
<div id="aside">
|
|
<h3 class="productName">四维指房宝</h3>
|
|
<h3 class="productName">四维指房宝</h3>
|
|
<div class="menuList">
|
|
<div class="menuList">
|
|
- <el-menu
|
|
|
|
- :default-active="activeName"
|
|
|
|
- :unique-opened="true"
|
|
|
|
- class="el-menu-vertical"
|
|
|
|
- @open="handleOpen"
|
|
|
|
- @close="handleClose"
|
|
|
|
- @select="handleClick"
|
|
|
|
- router
|
|
|
|
- >
|
|
|
|
- <div v-for="(item, index) in muenList" :key="index">
|
|
|
|
- <el-menu-item v-if="!item.children" :index="item.path">
|
|
|
|
|
|
+ <el-menu text-color="#fff"
|
|
|
|
+ background-color="#2f4050"
|
|
|
|
+ :default-active="activeName"
|
|
|
|
+ :unique-opened="true"
|
|
|
|
+ class="el-menu-vertical"
|
|
|
|
+ @open="handleOpen"
|
|
|
|
+ @close="handleClose"
|
|
|
|
+ @select="handleClick"
|
|
|
|
+ router>
|
|
|
|
+ <div v-for="(item, index) in muenList"
|
|
|
|
+ :key="index">
|
|
|
|
+ <el-menu-item v-if="!item.children"
|
|
|
|
+ :index="item.path">
|
|
<i :class="item.icon"></i>
|
|
<i :class="item.icon"></i>
|
|
<span>{{ item.name }}</span>
|
|
<span>{{ item.name }}</span>
|
|
</el-menu-item>
|
|
</el-menu-item>
|
|
- <el-sub-menu v-else :index="item.key">
|
|
|
|
|
|
+ <el-sub-menu v-else
|
|
|
|
+ :index="item.key">
|
|
<template #title>
|
|
<template #title>
|
|
<i :class="item.icon"></i>
|
|
<i :class="item.icon"></i>
|
|
<span>{{ item.name }}</span>
|
|
<span>{{ item.name }}</span>
|
|
</template>
|
|
</template>
|
|
- <div v-for="(j, j_index) in item.children" :key="j_index">
|
|
|
|
|
|
+ <div v-for="(j, j_index) in item.children"
|
|
|
|
+ :key="j_index">
|
|
<el-menu-item :index="j.path">{{ j.name }}</el-menu-item>
|
|
<el-menu-item :index="j.path">{{ j.name }}</el-menu-item>
|
|
</div>
|
|
</div>
|
|
</el-sub-menu>
|
|
</el-sub-menu>
|
|
@@ -31,93 +35,96 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-import { defineComponent, reactive, ref, toRefs, onMounted } from "vue";
|
|
|
|
-import { useRoute, useRouter } from "vue-router";
|
|
|
|
-import { useStore } from "vuex";
|
|
|
|
|
|
+import { defineComponent, reactive, ref, toRefs, onMounted } from 'vue'
|
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
|
+import { useStore } from 'vuex'
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
- name: "Aside",
|
|
|
|
|
|
+ name: 'Aside',
|
|
components: {},
|
|
components: {},
|
|
setup(props, ctx) {
|
|
setup(props, ctx) {
|
|
- const router = useRouter();
|
|
|
|
- const route = useRoute();
|
|
|
|
- const store = useStore();
|
|
|
|
|
|
+ const router = useRouter()
|
|
|
|
+ const route = useRoute()
|
|
|
|
+ const store = useStore()
|
|
const data = reactive({
|
|
const data = reactive({
|
|
muenList: [
|
|
muenList: [
|
|
{
|
|
{
|
|
- name: "首页",
|
|
|
|
- path: "/home",
|
|
|
|
- icon: "el-icon-location",
|
|
|
|
- key: "home",
|
|
|
|
|
|
+ name: '首页',
|
|
|
|
+ path: '/home',
|
|
|
|
+ icon: 'el-icon-location',
|
|
|
|
+ key: 'home',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: "VR场景",
|
|
|
|
|
|
+ name: 'VR场景',
|
|
path: null,
|
|
path: null,
|
|
- icon: "el-icon-document",
|
|
|
|
- key: "vrList",
|
|
|
|
|
|
+ icon: 'el-icon-document',
|
|
|
|
+ key: 'vrList',
|
|
children: [
|
|
children: [
|
|
{
|
|
{
|
|
- name: "场景列表",
|
|
|
|
- path: "/list",
|
|
|
|
- icon: "",
|
|
|
|
- key: "list",
|
|
|
|
|
|
+ name: '场景列表',
|
|
|
|
+ path: '/sence',
|
|
|
|
+ icon: '',
|
|
|
|
+ key: 'sence',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: "直播间",
|
|
|
|
- path: "/brand",
|
|
|
|
- icon: "",
|
|
|
|
- key: "brand",
|
|
|
|
|
|
+ name: '直播间',
|
|
|
|
+ path: '/live',
|
|
|
|
+ icon: '',
|
|
|
|
+ key: 'live',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: "商品管理",
|
|
|
|
|
|
+ name: '商品管理',
|
|
path: null,
|
|
path: null,
|
|
- icon: "el-icon-setting",
|
|
|
|
- key: "product",
|
|
|
|
|
|
+ icon: 'el-icon-setting',
|
|
|
|
+ key: 'product',
|
|
children: [
|
|
children: [
|
|
{
|
|
{
|
|
- name: "商品属性",
|
|
|
|
- path: "/productNature",
|
|
|
|
- icon: "",
|
|
|
|
- key: "productNature",
|
|
|
|
|
|
+ name: '商品属性',
|
|
|
|
+ path: '/productNature',
|
|
|
|
+ icon: '',
|
|
|
|
+ key: 'productNature',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: "商品列表",
|
|
|
|
- path: "/productList",
|
|
|
|
- icon: "",
|
|
|
|
- key: "productList",
|
|
|
|
|
|
+ name: '商品列表',
|
|
|
|
+ path: '/productList',
|
|
|
|
+ icon: '',
|
|
|
|
+ key: 'productList',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- activeName: "",
|
|
|
|
- });
|
|
|
|
|
|
+ activeName: '',
|
|
|
|
+ })
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
// data.activeName = route.meta.title;
|
|
// data.activeName = route.meta.title;
|
|
- data.activeName = route.path;
|
|
|
|
- console.log(data.activeName);
|
|
|
|
|
|
+ let storeMenuList = JSON.parse(localStorage.getItem('menuList'))
|
|
|
|
+ console.log(storeMenuList)
|
|
|
|
+ // this.muenList = storeMenuList
|
|
|
|
+ data.activeName = route.path
|
|
|
|
+ console.log(data.activeName)
|
|
// console.log(route.meta.title);
|
|
// console.log(route.meta.title);
|
|
- });
|
|
|
|
|
|
+ })
|
|
const handleOpen = (key, keyPath) => {
|
|
const handleOpen = (key, keyPath) => {
|
|
// console.log(key, keyPath);
|
|
// console.log(key, keyPath);
|
|
- };
|
|
|
|
|
|
+ }
|
|
const handleClose = (key, keyPath) => {
|
|
const handleClose = (key, keyPath) => {
|
|
// console.log(key, keyPath);
|
|
// console.log(key, keyPath);
|
|
- };
|
|
|
|
|
|
+ }
|
|
const handleClick = (key, keyPath) => {
|
|
const handleClick = (key, keyPath) => {
|
|
// console.log(key, keyPath);
|
|
// console.log(key, keyPath);
|
|
// console.log(route);
|
|
// console.log(route);
|
|
- store.commit("setNavTitle", route.name);
|
|
|
|
- console.log(store.state.navTitle);
|
|
|
|
- };
|
|
|
|
|
|
+ // store.commit("setNavTitle", route.name);
|
|
|
|
+ // console.log(store.state.navTitle);
|
|
|
|
+ }
|
|
return {
|
|
return {
|
|
handleOpen,
|
|
handleOpen,
|
|
handleClose,
|
|
handleClose,
|
|
handleClick,
|
|
handleClick,
|
|
...toRefs(data),
|
|
...toRefs(data),
|
|
- };
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
-});
|
|
|
|
|
|
+})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
@@ -133,6 +140,7 @@ export default defineComponent({
|
|
}
|
|
}
|
|
.menuList {
|
|
.menuList {
|
|
.el-menu {
|
|
.el-menu {
|
|
|
|
+ border-right: none;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|