<!--
 * @Author: ch
 * @Date: 2022-04-19 16:19:32
 * @LastEditors: ch
 * @LastEditTime: 2022-04-19 17:29:48
 * @Description: file content
-->
<template>
	<u-modal :show="show" :content="content" showCancelButton 
		@confirm="myConfirm" @cancel="myCancel"/>
</template>
<script>
export default {
	props : {
		content : {
			type : String,
			default : ''
		},
		confirmTxt : {
			type : String,
			default : '确认'
		},
		confirm : {
			type : Function,
			default: function(){}
		},
		cancelTxt : {
			type : String,
			default : '取消'
		},
		cancel : {
			type : Function,
			default : function(){}
		}
	},
	data(){
		return {
			show : true
		}
	},
	methods : {
		async myConfirm(){
			this.show = false;
			await this.confirm();
			document.body.removeChild(this.$el);
			
		},
		async myCancel(){
			this.show = false;
			await this.cancel();
			document.body.removeChild(this.$el);
		}
	}
}
</script>