Blame view

src/views/service.vue 1.75 KB
a5f51b80   liuqimichale   完成页面
1
  <template>
5fcc1352   Andy   add 车主模板 左侧菜单
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
    <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>
a5f51b80   liuqimichale   完成页面
31
32
33
34
    </div>
  </template>
  
  <script>
5fcc1352   Andy   add 车主模板 左侧菜单
35
36
    import config from '../components/config'
    import NavMenu from '../components/NavMenu';
a5f51b80   liuqimichale   完成页面
37
  
5fcc1352   Andy   add 车主模板 左侧菜单
38
39
40
41
42
43
44
45
46
    export default {
      name: 'service',
      data(){
        return {
          tagsList: [],
          collapse: false,
          totalList:[],
          isId:"first",
          openeds:["first"],
a5f51b80   liuqimichale   完成页面
47
        }
5fcc1352   Andy   add 车主模板 左侧菜单
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
      },
      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(){
  
a5f51b80   liuqimichale   完成页面
74
        }
5fcc1352   Andy   add 车主模板 左侧菜单
75
76
77
78
79
80
      },
      watch:{
  
        $route(to,from){
  
          this.isId = to.path.replace('/','');
a5f51b80   liuqimichale   完成页面
81
        }
5fcc1352   Andy   add 车主模板 左侧菜单
82
83
84
85
      },
      created(){
        this.totalList = config.childs
      },
a5f51b80   liuqimichale   完成页面
86
    }
5fcc1352   Andy   add 车主模板 左侧菜单
87
88
89
  </script>
  <style scoped>
  
a5f51b80   liuqimichale   完成页面
90
91
  
  </style>