|
2 | 2 | <div class="layout">
|
3 | 3 | <el-container style="min-height: 100vh">
|
4 | 4 | <el-header>
|
5 |
| - <div width="200px" class="logo"></div> |
| 5 | + <div width="200px" class="logo"/> |
6 | 6 | </el-header>
|
7 | 7 | <el-container>
|
8 | 8 | <el-aside width="200px">
|
|
22 | 22 | <template v-if="item.sub">
|
23 | 23 | <el-submenu :index="item.key" :key="item.key">
|
24 | 24 | <template slot="title">
|
25 |
| - <i class="el-icon-location"></i> |
| 25 | + <i class="el-icon-location"/> |
26 | 26 | <span>{{ item.name }}</span>
|
27 | 27 | </template>
|
28 | 28 | <el-menu-item v-for="subItem in item.sub" :index="subItem.key" :key="subItem.key">
|
|
32 | 32 | </template>
|
33 | 33 | <template v-else>
|
34 | 34 | <el-menu-item :index="item.key" :key="item.key">
|
35 |
| - <i class="el-icon-menu"></i> |
| 35 | + <i class="el-icon-menu"/> |
36 | 36 | <span slot="title">{{ item.name }}</span>
|
37 | 37 | </el-menu-item>
|
38 | 38 | </template>
|
|
44 | 44 | </el-aside>
|
45 | 45 | <el-container>
|
46 | 46 | <el-main>
|
47 |
| - <slot name="content"></slot> |
| 47 | + <slot name="content"/> |
48 | 48 | </el-main>
|
49 | 49 | <el-footer>July Design ©2017 Created by July</el-footer>
|
50 | 50 | </el-container>
|
|
54 | 54 | </template>
|
55 | 55 |
|
56 | 56 | <script>
|
57 |
| - const operateUrl = 'claa/menulist'; |
| 57 | +const operateUrl = 'claa/menulist'; |
58 | 58 |
|
59 |
| - export default { |
60 |
| - name: 'layout', |
61 |
| - data() { |
62 |
| - return { |
63 |
| - defaultActive: 'item1' |
64 |
| - }; |
65 |
| - }, |
| 59 | +export default { |
| 60 | + name: 'Layout', |
| 61 | + data() { |
| 62 | + return { |
| 63 | + defaultActive: 'item1' |
| 64 | + }; |
| 65 | + }, |
66 | 66 |
|
67 |
| - created() { |
68 |
| - this.defaultActive = this.$route.path.split('/')[1] ? this.$route.path.split('/')[1] : 'item1'; |
69 |
| - }, |
70 |
| - mounted() { |
71 |
| - this.doQuery(); |
72 |
| - }, |
| 67 | + created() { |
| 68 | + this.defaultActive = this.$route.path.split('/')[1] ? this.$route.path.split('/')[1] : 'item1'; |
| 69 | + }, |
| 70 | + mounted() { |
| 71 | + this.doQuery(); |
| 72 | + }, |
73 | 73 |
|
74 |
| - computed: { |
75 |
| - menu() { |
76 |
| - return this.$store.state.menu.menuList; |
77 |
| - } |
| 74 | + computed: { |
| 75 | + menu() { |
| 76 | + return this.$store.state.menu.menuList; |
| 77 | + } |
| 78 | + }, |
| 79 | + methods: { |
| 80 | + handleOpen(key, keyPath) { |
| 81 | + console.log(key, keyPath); |
| 82 | + }, |
| 83 | + handleClose(key, keyPath) { |
| 84 | + console.log(key, keyPath); |
78 | 85 | },
|
79 |
| - methods: { |
80 |
| - handleOpen(key, keyPath) { |
81 |
| - console.log(key, keyPath); |
82 |
| - }, |
83 |
| - handleClose(key, keyPath) { |
84 |
| - console.log(key, keyPath); |
85 |
| - }, |
86 |
| - doQuery() { |
87 |
| - const param = { |
88 |
| - loadingFlag: true, |
89 |
| - url: operateUrl, |
90 |
| - method: 'POST', |
91 |
| - data: { |
92 |
| - type: 'on' |
93 |
| - } |
94 |
| - }; |
95 |
| - this.$store.dispatch('fetch', param); |
96 |
| - } |
| 86 | + doQuery() { |
| 87 | + const param = { |
| 88 | + loadingFlag: true, |
| 89 | + url: operateUrl, |
| 90 | + method: 'POST', |
| 91 | + data: { |
| 92 | + type: 'on' |
| 93 | + } |
| 94 | + }; |
| 95 | + this.$store.dispatch('fetch', param); |
97 | 96 | }
|
98 |
| - }; |
| 97 | + } |
| 98 | +}; |
99 | 99 | </script>
|
100 | 100 |
|
101 | 101 | <style lang="scss" scoped>
|
|
0 commit comments