service.vue
1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<template>
<div >
<el-container style="min-height: 550px">
<!--<el-aside width="210px" style="background-color: rgb(84, 92, 100);">-->
<el-aside width="210px" style="background-color: rgb(84, 92, 100);">
<!--左侧菜单组件-->
<el-menu
:default-active="isId"
class="el-menu-vertical-demo"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b"
@open="handleOpen"
@close="handleClose"
@select="handleSelect"
:default-openeds="openeds" unique-opened router>
<NavMenu :navMenus="totalList"></NavMenu>
</el-menu>
</el-aside>
<el-container>
<el-main class="app-container">
<router-view></router-view>
</el-main>
</el-container>
</el-container>
</div>
</template>
<script>
import config from '../components/config'
import NavMenu from '../components/NavMenu';
export default {
name: 'service',
data(){
return {
tagsList: [],
collapse: false,
totalList:[],
isId:"first",
openeds:["first"],
}
},
components:{
NavMenu
},
beforeRouteEnter (to, from, next) {
console.log("我从==哪里来",to)
var self = this
next(vm=>{
console.log(to)
vm.isId = to.path.replace('/','');
})
},
methods: {
handleSelect(key,keyPath){
console.log("=======",key,keyPath);
},
handleOpen(){
},
handleClose(){
}
},
watch:{
$route(to,from){
this.isId = to.path.replace('/','');
}
},
created(){
this.totalList = config.childs
},
}
</script>
<style scoped>
</style>