<template>
	<view>
		<uni-popup ref="message" type="message">
			<uni-popup-message :type="msgType" :message="messageText" :duration="duration"></uni-popup-message>
		</uni-popup>
	</view>
</template>

<script setup lang="ts">
	import {ref,defineProps,onMounted,defineEmits} from 'vue'
	let  msgType =  ref('warn')
	let  {messageText} =  defineProps(['messageText'])
	let emits = defineEmits(['onFinish'])
	let duration = ref(2000)
	const message = ref(null)
	onMounted(()=>{
		message.value.open()
	})
	setTimeout(()=>{
		emits('onFinish')
	},duration.value)
</script>