<template>
    <a-popconfirm :title="title" ok-text="确认" cancel-text="取消" @confirm="onOk">
        <a>删除</a>
    </a-popconfirm>
</template>

<script>
import { EMPTY_FUN } from '@/utils';
import { delReq } from '@/utils';

export default {
    props: {
        url: String,
        cb: {
            type: Function,
            default: EMPTY_FUN,
        },
        title: {
            type: String,
            default: '确认是否删除',
        },
    },
    methods: {
        async onOk() {
            await delReq(this.url);
            this?.cb();
        },
    },
};
</script>
