labelClassify.vue
1.45 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
<template>
<div class="label-container">
<div class="side-title">
<Icon name="icon-label"></Icon>
标签分类
</div>
<div class="label-content">
<div
class="label-item"
v-for="item in labelList"
:key="item.label"
:style="{ backgroundColor: item.bgColor }"
>
<router-link :to="`/label/${item.label}`">
{{ item.label }}
</router-link>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
name: "labelClassify",
components: {},
props: {},
computed: {
...mapGetters({ labelList: "label/labelList" }),
},
data() {
return {};
},
watch: {},
created() { },
mounted() { },
beforeDestroy() { },
methods: {},
};
</script>
<style lang="less" scoped>
.label-container {
background-color: #fff;
margin-top: 20px;
border-radius: 4px;
.label-content {
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 20px;
.label-item {
height: 30px;
display: flex;
justify-content: center;
align-items: center;
padding: 12px;
color: #fff;
margin: 4px;
border-radius: 12px;
transition: 1s ease all;
position: relative;
&:hover {
border-radius: 0;
cursor: pointer;
}
a {
color: #fff;
}
}
}
}
</style>