<template>
	<view>
		<uni-popup ref="alertDialog" type="dialog">
			<uni-popup-dialog :type="{msgType}" cancelText="关闭" confirmText="同意" :title="titleName" :content="contentText" @confirm="dialogConfirm"
				@close="dialogClose"></uni-popup-dialog>
		</uni-popup>
	</view>
</template>

<script setup lang="ts">
	import {ref, onMounted,defineProps,defineEmits} from 'vue'
	import { log } from '../../framework/log';
	const alertDialog = ref(null)
	const {titleName,contentText} = defineProps(['titleName','contentText'])
	const emit = defineEmits(['dialogConfirm','dialogClose'])
	let  msgType =  ref('warn')
	function dialogClose() {
		emit('dialogClose')
		log.Debug('点击关闭')
	}
	function dialogConfirm() {
		log.Debug('点击确认')
		emit('dialogConfirm')
	}
	onMounted(()=>{
		log.Debug("alertDialog")
		alertDialog.value.open()
	})
	
</script>

<style>
</style>