<!-- 编辑弹窗 -->
<template>
    <ele-modal
        form
        :width="460"
        v-model="visible"
        title="用户绑定标签"
        @open="handleOpen"
    >
        <template #footer>
            <el-button @click="handleCancel">关闭</el-button>
            <el-button type="primary" @click="handleCancel">确定</el-button>
        </template>
    </ele-modal>
</template>

<script setup>
    import { ref, reactive, nextTick } from 'vue';

    /** 弹窗是否打开 */
    const visible = defineModel({ type: Boolean });

    /** 关闭弹窗 */
    const handleCancel = () => {
        visible.value = false;
    };

    /** 弹窗打开事件 */
    const handleOpen = () => {
        visible.value = true;
        nextTick(() => console.log('打开'));
    };

    defineExpose({
        handleOpen
    });
</script>
