<template>
    <van-popup v-model="showPopup" round :style="{ width:'75%'}">
        <div>
            {{title}}
        </div>
        <div style="margin: 20px 10px">
            <slot></slot>
        </div>
        <div>
            <van-button type="primary" @click="onCancel">取消</van-button>
            <van-button type="info" @click="onConfirm">确定</van-button>
        </div>
    </van-popup>
</template>

<script>
    export default {
        name: "ConfirmDialog",
        props: {
            title: String,
        },
        data() {
            return {
                showPopup: true
            }
        },
        methods: {
            onCancel() {
                this.$emit('close')
            },
            onConfirm() {
                this.$emit('confirm')
            }
        }
    }
</script>

<style scoped>

</style>
