Files
ruoyi-plus-vben5/playground/src/views/examples/modal/base-demo.vue
Netfan f380452ef0 feat: modal and drawer locking improve (#5648)
* feat: add `unlock` for modalApi

* fix: modal's close button style in locking

* fix: fix modal's close button disabled on locking

* feat: add `lock` and `unlock` for drawerApi
2025-03-04 22:00:32 +08:00

35 lines
748 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script lang="ts" setup>
import { useVbenModal } from '@vben/common-ui';
import { Button, message } from 'ant-design-vue';
const [Modal, modalApi] = useVbenModal({
onCancel() {
modalApi.close();
},
onClosed() {
message.info('onClosed关闭动画结束');
},
onConfirm() {
message.info('onConfirm');
// modalApi.close();
},
onOpened() {
message.info('onOpened打开动画结束');
},
});
function lockModal() {
modalApi.lock();
setTimeout(() => {
modalApi.unlock();
}, 3000);
}
</script>
<template>
<Modal class="w-[600px]" title="基础弹窗示例" title-tooltip="标题提示内容">
base demo
<Button type="primary" @click="lockModal">锁定弹窗</Button>
</Modal>
</template>