删除二级菜单组件

This commit is contained in:
2023-05-30 14:05:23 +08:00
parent f55fecbbee
commit 6d2dfe4112
6 changed files with 0 additions and 213 deletions

View File

@@ -1,43 +0,0 @@
<template>
<el-menu :default-active="activeIndex" @select="handleSelect">
<el-menu-item :index="menu.index" v-for="menu in menus" :key="menu.index">{{menu.label}}</el-menu-item>
</el-menu>
</template>
<script>
export default {
name: 'jxSidebar',
props: {
menus: Array
},
data () {
return {
activeIndex: '1'
}
},
created () {
this.menus.map(el => {
if (el.router === this.$route.path) {
this.activeIndex = el.index
}
})
},
methods: {
handleSelect (key) {
this.activeIndex = key
this.$router.push({
path: this.menus[Number(key) - 1].router
})
}
}
}
</script>
<style lang="stylus" scoped>
>>>.el-menu-item a
color #909399
>>>.is-active
background-color: #ecf5ff
>>>.is-active a
color #409EFF
</style>