widget.vue
896 Bytes
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
<template>
<div class="widget" @click="onClick">
<i class="iconfont icon-class" :class="classes"></i>
<div class="desc">{{desc}}</div>
</div>
</template>
<script>
export default {
name: 'Widget',
props: {
classes: {
type: [Object, String],
default() {
return {
iconhome: true
};
}
},
desc: {
type: String,
default: '首页'
},
index: {
type: Number,
default: 0
}
},
data() {
return {};
},
computed: {
},
methods: {
onClick() {
this.$emit('click', this.index);
}
}
};
</script>
<style lang="scss" scoped>
.widget {
width: 98px;
height: 98px;
display: flex;
font-size: 0;
flex-direction: column;
align-items: center;
color: #8c8c8c;
}
.icon-class {
font-size: 50px;
margin-top: 5px;
}
.desc {
font-size: 20px;
margin-top: -10px;
}
</style>