<template>
	<view>
		<view class="form-item">
			<view class="label">上传相册</view>
			<view>{{imgList.length}}/{{number}}</view>
		</view>
		<view class="upload-box">
			<shmily-drag-image :number="number" :cols="5" v-model="imgList"></shmily-drag-image>
		</view>
	</view>
</template>

<script>
	export default {
		components: {
			
		},
		props: {
			number: {
			  type: Number,
			  default: 6
			},
			modelValue: {
			  type: Array,
			  default: []
			},
		},
		data() {
			return {
				imgList: [],
			}
		},
		created() {
			this.imgList = this.modelValue;
		},
		computed: {
			
		},
		watch: {
			imgList: {
				handler: function(newVal, oldVal) {
					this.$emit('update:modelValue', newVal); 
				}
			},
			modelValue: {
				handler: function(newVal, oldVal) {
					this.imgList = newVal;
				}
			},
		},
		methods: {
			
		}
	}
</script>

<style lang="scss" scoped>
	.form-item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		
		.label {
			font-size: 28rpx;
			min-width: 200rpx;
			padding-left: 2px;
		}
	}
	
	.upload-box {
		padding: 15px 0;
	}
</style>