<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: 0,
					},
					{
						name: '关闭',
						value: 1,
					},
				],
			}
		},
		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: 2px;
		padding-bottom: 22px;
		
		.label {
			font-size: 28rpx;
			min-width: 200rpx;
		}
	}
	
	.radio-box {
		display: flex;
		justify-content: space-between;
		align-items: center;
		
		.text {
			width: 100rpx;
			height: 50rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			background-color: #ececec;
			color: #949494;
			border-radius: 10rpx;
			margin-left: 10px; 
		}
		
		.active {
			color: #fff;
			background-color: #949494;
		}
	}
</style>