base-demo.vue 744 B

12345678910111213141516171819202122232425262728293031323334
  1. <script lang="ts" setup>
  2. import { useVbenModal } from '@vben/common-ui';
  3. import { Button, message } from 'ant-design-vue';
  4. const [Modal, modalApi] = useVbenModal({
  5. onCancel() {
  6. modalApi.close();
  7. },
  8. onClosed() {
  9. message.info('onClosed:关闭动画结束');
  10. },
  11. onConfirm() {
  12. message.info('onConfirm');
  13. // modalApi.close();
  14. },
  15. onOpened() {
  16. message.info('onOpened:打开动画结束');
  17. },
  18. });
  19. function lockModal() {
  20. modalApi.lock();
  21. setTimeout(() => {
  22. modalApi.unlock();
  23. }, 3000);
  24. }
  25. </script>
  26. <template>
  27. <Modal class="w-150" title="基础弹窗示例" title-tooltip="标题提示内容">
  28. base demo
  29. <Button type="primary" @click="lockModal">锁定弹窗</Button>
  30. </Modal>
  31. </template>