<template>
    <view>
        <view @click="modal = true" style="height: 100%">
            <slot></slot>
        </view>
        <tui-modal :show="modal" @click="handleClick" @cancel="modal = false" title="确认删除" content="谨慎操作，删除数据不可恢复"></tui-modal>
    </view>
</template>
<script>
export default {
    data() {
        return {
            modal: false,
        };
    },
    methods: {
        handleClick(e) {
            let index = e.index;
            if (index !== 0) {
                this.$emit("confirm");
            } else {
                this.$emit("cancel");
            }
            this.modal = false;
        },
    },
};
</script>
