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
<!-- ******************* 单选框 ******************* -->
<template>
<view class="list">
<view v-for="(item,index) in settings" :key="index" :class="{'txt':true,'active':item.key===dataValue}"
@click="setValue(item.key)">{{item.label}}</view>
</view>
</template>
<script>
import stringMixin from './stringMixin'
export default {
name: 'XhRadio',
components: {},
mixins: [stringMixin],
props: {},
data() {
return {}
},
computed: {
settings(){
return this.item.fieldsOptions || []
}
},
watch: {},
mounted() {},
methods: {
setValue(txt){
this.dataValue = txt
this.valueChange(txt)
}
}
}
</script>
<style lang="scss" scoped>
.list{
display: flex;
flex-wrap: wrap;
.txt{
color:#666;
padding:10rpx 30rpx;
margin: 5rpx;
background: #F4F5F7;
border-radius: 10rpx;
display: flex;
flex-wrap: wrap;
line-height: 50rpx;
text-align: center;
max-width: 48%;
&.active{
background-color: #2272FF;
color:#fff;
}
}
}
</style>