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