<template>
	<view class="flex uni-row">
		<view class="" >
			<u-checkbox size="50"  v-model="checkAll" @change="checkAllItems" > 
			</u-checkbox>
		</view>
		<view>
			<text style="margin-left: 10rpx; font-size: 35rpx;font-weight: bold;">全选({{checkCount}}/{{allCount}})</text>
		</view>
	</view>


</template>

<script>
	export default {
		data() {
			return {
				checkAll: false
			}
		},
		props: {
			checkCount: {
				type: Number,
				default: 0
			},
			allCount: {
				type: Number,
				default: 0
			},
		},
		methods: {
			checkAllItems() {
				let that = this;
				that.checkAll = !that.checkAll;
				that.$emit("checkAllItems", that.checkAll);
			},

			changeCheckAllState() {
				let that = this;
				that.checkAll = that.checkCount == that.allCount
				this.$forceUpdate();
			}
		}
	}
</script>

<style>
</style>