<template>
	<view class="select-class">
		<view @click="itemClick(item,index)" :class="active==item.id ?'active' :''" v-for="(item,index) in list"
			:key="index" class="select-class-item">
			<text style="margin-right: 20rpx;">{{item.class_name}}</text> <uni-icons class="select-class-item-icon"
				type="checkmarkempty" v-if="active==item.id" color="#05CCA1" size="16"></uni-icons>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				default: () => []
			},
			active:{
			
				default: () => 0
			}
		},
		data() {
			return {
				
			}
		},
		methods: {
			itemClick(item, index) {
				
				this.$emit('itemClick',item)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.select-class-item {
		width: 100%;
		line-height: 82rpx;
		text-align: center;
		box-sizing: border-box;
		height: 82rpx;
		border-bottom: 1px solid #f2f2f2;
		font-size: 32rpx;
		position: relative;

		.select-class-item-icon {
			position: absolute;
			left: 62%;
		}
	}

	.active {
		color: #05CCA1;
	}
</style>