<template>
	<view class="form-item">
		<view class="label">性别</view>
		<view class="radio-box">
			<view @click="change(item)" class="text" :class="item.value == valueDom ? 'active' : ''"  v-for="(item,index) in list">{{item.name}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {
			
		},
		props: {
			modelValue: '',
		},
		data() {
			return {
				list: [
					{
						name: '男',
						value: '1',
					},
					{
						name: '女',
						value: '2',
					},
				],
			}
		},
		created() {
			
		},
		computed: {
			valueDom() {
				return this.modelValue;
			},
		},
		watch: {
			
		},
		methods: {
			change(e) {
				this.$emit('update:modelValue', e.value); 
			},
		}
	}
</script>

<style lang="scss" scoped>
	.form-item {
		background-color: #fff;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-left: 17px;
		padding-bottom: 22px;
		
		.label {
			font-size: 28rpx;
			min-width: 200rpx;
		}
	}
	
	.radio-box {
		display: flex;
		justify-content: space-between;
		align-items: center;
		
		.text {
			width: 70rpx;
			height: 70rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			background-color: #ececec;
			color: #949494;
			border-radius: 100%;
			margin-left: 10px; 
		}
		
		.active {
			color: #fff;
			background-color: #949494;
		}
	}
</style>