提交 ddf4a1c0 编写于 作者: E Evan

chore: daily optimization

上级 c732170e
<template>
<div>
<el-menu
:default-active="'/admin/users'"
:default-active="currentPath"
class="el-menu-admin"
router
@select="handleSelect"
mode="vertical"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b">
<div style="height: 80px;"></div>
<template v-for="(item,i) in adminMenus">
<!--index 没有用但是必需字段-->
<el-submenu :key="i" :index="i + ''" style="text-align: left">
<el-submenu v-for="(item,i) in adminMenus" :key="i" :index="i + ''" style="text-align: left">
<span slot="title" style="font-size: 17px;">
<i :class="item.iconCls"></i>
{{item.nameZh}}
</span>
<el-menu-item v-for="child in item.children" :key="child.path" :index="child.path">
<el-menu-item v-for="(child,j) in item.children" :key="j" :index="child.path">
<i :class="child.icon"></i>
{{ child.nameZh }}
</el-menu-item>
</el-submenu>
</template>
</el-menu>
</div>
</template>
......@@ -29,9 +28,21 @@
<script>
export default {
name: 'AdminMenu',
data () {
return {
// currentPath: this.$route.path
}
},
computed: {
adminMenus () {
return this.$store.state.adminMenus
},
currentPath () {
return this.$route.path
}
},
methods: {
handleSelect (key, keyPath) {
}
}
}
......
<template>
<span style="font-size: 200px">test1</span>
</template>
<script>
export default {
name: 'UserRole'
}
</script>
<style scoped>
</style>
<template>
<div>
<el-menu
:default-active="'/index'"
:default-active="currentPath"
router
mode="horizontal"
background-color="white"
......@@ -29,6 +29,7 @@
name: 'NavMenu',
data () {
return {
// currentPath: this.$route.path,
navList: [
{name: '/index', navItem: '首页'},
{name: '/jotter', navItem: '笔记本'},
......@@ -41,6 +42,9 @@
computed: {
hoverBackground () {
return '#ffd04b'
},
currentPath () {
return this.$route.path
}
},
methods: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册