|
@@ -2,7 +2,7 @@
|
|
<div id="menus">
|
|
<div id="menus">
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-menu :default-active="$route.path" background-color="#353852" text-color="#ffffff" active-text-color="#409eff" router>
|
|
|
|
|
|
+ <!-- <el-menu :default-active="$route.path" background-color="#353852" text-color="#ffffff" active-text-color="#409eff" router>
|
|
<el-menu-item index="/">
|
|
<el-menu-item index="/">
|
|
<i class="iconfont iconshouye"></i>
|
|
<i class="iconfont iconshouye"></i>
|
|
<span slot="title">后台首页</span>
|
|
<span slot="title">后台首页</span>
|
|
@@ -27,6 +27,16 @@
|
|
<i class="iconfont icontongji"></i>
|
|
<i class="iconfont icontongji"></i>
|
|
<span slot="title">统计管理</span>
|
|
<span slot="title">统计管理</span>
|
|
</el-menu-item>
|
|
</el-menu-item>
|
|
|
|
+ </el-menu> -->
|
|
|
|
+ <el-menu background-color="#353852" text-color="#ffffff" active-text-color="#409eff">
|
|
|
|
+ <template v-for="item in menu">
|
|
|
|
+ <template>
|
|
|
|
+ <el-menu-item :index="item.path" @click="selectMenu(item.path)" :key="item.name">
|
|
|
|
+ <i v-if="item.icon" :class="item.icon"></i>
|
|
|
|
+ <span v-if="item.name" slot="title">{{ item.name }}</span>
|
|
|
|
+ </el-menu-item>
|
|
|
|
+ </template>
|
|
|
|
+ </template>
|
|
</el-menu>
|
|
</el-menu>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -34,21 +44,28 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { index, user, role, live, room, stat } from '@/util/role_menu.js';
|
|
|
|
+import * as menus from '@/util/role_menu.js';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
export default {
|
|
export default {
|
|
name: 'menus',
|
|
name: 'menus',
|
|
props: {},
|
|
props: {},
|
|
components: {},
|
|
components: {},
|
|
data: function() {
|
|
data: function() {
|
|
- return {};
|
|
|
|
|
|
+ return {
|
|
|
|
+ menu: [],
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.search();
|
|
},
|
|
},
|
|
- created() {},
|
|
|
|
methods: {
|
|
methods: {
|
|
- handleOpen(key, keyPath) {
|
|
|
|
- console.log(key, keyPath);
|
|
|
|
|
|
+ search() {
|
|
|
|
+ this.menu.push(index, user, role, live, room, stat);
|
|
|
|
+ return;
|
|
},
|
|
},
|
|
- handleClose(key, keyPath) {
|
|
|
|
- console.log(key, keyPath);
|
|
|
|
|
|
+ selectMenu(path) {
|
|
|
|
+ this.$router.push({ path: path });
|
|
},
|
|
},
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -60,6 +77,14 @@ export default {
|
|
metaInfo() {
|
|
metaInfo() {
|
|
return { title: this.$route.meta.title };
|
|
return { title: this.$route.meta.title };
|
|
},
|
|
},
|
|
|
|
+ // watch: {
|
|
|
|
+ // user: {
|
|
|
|
+ // handler(val, oval) {
|
|
|
|
+ // if (val && !_.isEqual(val, oval)) this.search();
|
|
|
|
+ // },
|
|
|
|
+ // immediate: true,
|
|
|
|
+ // },
|
|
|
|
+ // },
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|