埃驰前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

60 lines
1.4 KiB

<template>
<div class="dashboardPage">
<el-tree
:data="navList"
:props="defaultProps"
@node-click="goPage"
></el-tree>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
name: 'Dashboard',
data() {
return {
navList:[],
defaultProps: {
children: 'children',
label: 'title'
}
}
},
computed: {
...mapGetters([
'permission_routes'
])
},
mounted(){
this.initData(this.permission_routes)
},
methods:{
initData(data){
data.forEach(item => {
if(!item.hidden && item.path !== '/' && item.meta) {
let _item = {
title:item.meta.title,
name:item.name,
path:item.path,
children:item.children
}
this.navList.push(_item)
}
if(!item.hidden && item.children){
this.initData(item.children)
}
})
},
goPage(item){
this.$router.push({name: item.name})
},
}
}
</script>
<style lang="scss" scoped>
.dashboardPage{
padding:30px 10px;
background: #fff;
}
</style>