index.vue 604 Bytes
Newer Older
1
<template>
2
    <a-popconfirm :title="title" ok-text="确认" cancel-text="取消" @confirm="onOk">
3 4 5 6 7 8
        <a>删除</a>
    </a-popconfirm>
</template>

<script>
import { EMPTY_FUN } from '@/utils';
水落(YangLei)'s avatar
水落(YangLei) committed
9
import { delReq } from '@/utils';
10 11 12

export default {
    props: {
水落(YangLei)'s avatar
水落(YangLei) committed
13 14
        url: String,
        cb: {
15 16 17
            type: Function,
            default: EMPTY_FUN,
        },
18 19 20 21
        title: {
            type: String,
            default: '确认是否删除',
        },
22
    },
水落(YangLei)'s avatar
水落(YangLei) committed
23 24 25
    methods: {
        async onOk() {
            await delReq(this.url);
26
            this?.cb();
水落(YangLei)'s avatar
水落(YangLei) committed
27 28
        },
    },
29 30
};
</script>