index.vue 518 Bytes
Newer Older
1
<template>
水落(YangLei)'s avatar
水落(YangLei) committed
2
    <a-popconfirm 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 18
            type: Function,
            default: EMPTY_FUN,
        },
    },
水落(YangLei)'s avatar
水落(YangLei) committed
19 20 21 22 23 24
    methods: {
        async onOk() {
            await delReq(this.url);
            this.cb();
        },
    },
25 26
};
</script>