<template>
    <a-popconfirm 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,
        },
    },
    methods: {
        async onOk() {
            await delReq(this.url);
            this.cb();
        },
    },
};
</script>
