FilterItem.vue
922 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
<template>
<view style="margin-top: 40rpx;margin-left: 40rpx;">
<view>
<text style="color: #333;">{{ title }}</text>
</view>
<view class="u-flex" style="flex-wrap: wrap;">
<view v-for="(item, index) in filterList" :key="index" class="u-page__tag-item">
<u-tag
shape="circle"
size="large"
borderColor="#377DFF4D"
:bgColor="item.checked?'#f5f8ff':'#F6F6F6'"
:color="item.checked?'#377DFF':'#333'"
:text="item.name"
@click="radioClick(index)"
/>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
title: {
type: String,
default: ''
},
filterList: {
type: Array,
default: () => []
}
},
methods: {
radioClick(currentIndex) {
this.$emit('clickTag', currentIndex);
}
}
};
</script>
<style>
.u-page__tag-item {
margin-right: 20px;
margin-top: 20px;
}
</style>