<template>
  <basicModal @register="register" ref="modalRef">
    <template #default>
      <img :src="previewUrl" />
    </template>
  </basicModal>
</template>

<script lang="ts" setup>
  import { basicModal, useModal } from '@/components/Modal';

  defineProps({
    previewUrl: String,
  });

  const [register, { openModal }] = useModal({
    title: '预览',
    showCancelBtn: false,
    showOkBtn: false,
  });

  //导出方法
  defineExpose({
    openModal,
  });
</script>
