<template>
	<view class="promproot" @click="$emit('close')">
		<img :src="srcObj.url" alt="" v-if="srcObj.type == 'image/*'" />
		<video :src="srcObj.url" alt="" v-if="srcObj.type == 'video/*'" controls />
		<span @click="$emit('close')"
			style="color: white;font-size: 32rpx;cursor: pointer;position: absolute;top: 50rpx;right: 50rpx;">X</span>
	</view>
</template>

<script>
	export default {
		name: "propmt",
		props: ["srcObj"],
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss" scoped>
	.promproot {
		position: fixed;
		background-color: RGBA(204, 204, 204, 0.8);
		top: 0;
		left: 0;
		height: 100%;
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		z-index: 10000000;

		img {
			max-width: 100%;
			max-height: 100%;
		}

		video {
			max-width: 100%;
			max-height: 100%;
		}
	}
</style>