<template>
	<view class="radioBox">
		<u-radio-group
		    v-model="radioVal.value"
		    placement="row"
			size="14"
		  >
		    <u-radio
		      :customStyle="{marginLeft: '8px'}"
		      v-for="(item, index) in radioData"
		      :key="index"
		      :label="item.name"
		      :name="item.id"
			  labelSize="14"
			  @change="changeRadio"
		    >
		    </u-radio>
		  </u-radio-group>
	</view>
</template>

<script>
	export default {
		props: ['radioData', 'radioVal'],
		
		data() {
			return {
				value: ''
			}
		},
		mounted() {
			this.$on('upDateRadio',(val)=>{
				this.value = val
			})
		},
		methods: {
			changeRadio(val) {
				// console.log(this.value)
				this.$emit('changeRadio', val)
			}
		}
	}
</script>

<style>
</style>