<template>
	<view class="list">
		<view v-for="(item,index) in settings" :key="index" :class="{'txt':true,'active':item===dataValue}" 
		@click="setValue(item)">{{item}}</view>
	</view>
</template>

<script>
	import stringMixin from './stringMixin'
	export default {
		name: 'XhRadio',
		components: {},
		mixins: [stringMixin],
		props: {},
		data() {
			return {}
		},
		computed: {
			settings(){
				return this.item.settings || []
			}
		},
		watch: {},
		mounted() {},
		methods: {
			setValue(txt){
				this.dataValue = txt
				this.valueChange(txt)
			}
		}
	}
</script>
<style lang="scss" scoped>
	.list{
		display: flex;
		.txt{
			color:#666;
			padding:10rpx;
			&.active{
				background-color: red;
				color:#fff;
			}
		}
	}
</style>
