<template>
	<view class="content">
		<view class="one">
			<upload :list="file" name="file" :count="6" @uplSuc="uplSuc" @uplDel="uplDel"></upload>
		</view>
	</view>
</template>

<script>
	import upload from "@/components/upload/index.vue";
	export default {
		components: {
			upload,
		},
		data() {
			return {
				file: [],
				logo: [ //
					{
						id: "20230216100918",
						name: "头像.jpg",
						status: "success",
						uid: 1676513358695,
						uri: "/files/projectadmin/imgurl/20230216100918.jpg",
						url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
					}
				]
			};
		},
		onLoad() {},
		methods: {
			// 图片上传
			uplSuc(e) {
				const that = this;
				that.$set(that, `${e.name}`, [...that[e.name], e.data]);
			},
			// 图片删除
			uplDel(e) {
				const that = this;
				let data = that[e.name];
				let arr = data.filter((i, index) => index != e.data.index);
				that.$set(that, `${e.name}`, arr);
			},

		},
	};
</script>

<style lang="scss"></style>
