MenuModule.vue
1.68 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
<template>
<section class="menu-module">
<div class="menu-module-item" v-for="(item, idx) in datas" :key="idx" @click="handleClickItem(item)">
<img v-if="item.icon" class="menu-icon" :src="item.icon">
<div v-else class="menu-icon"></div>
<span v-if="item.name" class="menu-name">{{item.name}}</span>
<div v-else class="menu-name white"></div>
</div>
</section>
</template>
<script>
export default {
name: 'MenuModule',
props: {
},
data () {
return {
datas: [
{ id: 1, name: '', icon: '', type: '' },
{ id: 2, name: '', icon: '', type: '' },
{ id: 3, name: '', icon: '', type: '' },
{ id: 4, name: '', icon: '', type: '' },
{ id: 5, name: '', icon: '', type: '' },
{ id: 6, name: '', icon: '', type: '' },
{ id: 7, name: '', icon: '', type: '' },
{ id: 8, name: '', icon: '', type: '' },
]
}
},
methods: {
handleClickItem (item) {
}
}
}
</script>
<style lang="less" scoped>
.white {
background: #eee;
}
.menu-module {
display: flex;
flex-wrap: wrap;
width: 100%;
padding-top: 5px;
@ModulePaddingTop: 25px;
.menu-module-item {
padding-top: @ModulePaddingTop;
width: 25%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
@IconSize: 50px;
.menu-icon {
background: #eee;
height: @IconSize;
width: @IconSize;
border-radius: calc(@IconSize / 2);
}
.menu-name {
display: block;
margin-top: 10px;
line-height: 20px;
min-height: 20px;
min-width: 90%;
font-size: 14px;
text-align: center;
color: #444444;
}
}
}
</style>