<template>
	<view>
		<checkbox-group @change="checkboxChange">
			<view class="idcardAdd-multi-write" v-for="(letterItem, letterIndex) in checkboxList" :key="letterIndex">
				<checkbox :value="letterIndex.toString()" :checked="isChecked(letterIndex)" color="#4e7bfe" style="transform:scale(.6); margin-top: -3rpx;"/>
				<text>{{letterItem}}</text>
			</view>
		</checkbox-group>
	</view>
</template>

<script>
	export default{
		name: 'mouldCheckbox',
		data(){
			return {
			}
		},
		computed: {
			isChecked(){
				return (index) => {
					return this.checkboxVlaue.findIndex(val => val == index) >= 0
				}
			}
		},
		props: {
			checkboxVlaue: {
				type: Array,
				default: () => {
					return []
				}
			},
			checkboxList: {
				type: Array,
				default: () => {
					return []
				}
			}
		},
		watch:{
			
		},
		methods: {
			checkboxChange(e){
				this.$emit('onCheckbox', e.detail.value)
			}
		}
	}
</script>

<style>
	.idcardAdd-multi-write {
		line-height: 70rpx;
		margin-top: $margin;
		display: flex;
		color: #999999;
	}
</style>