<template>
  <div>
    <el-button type="success" icon="view" size="small" @click="handlePdfPreview">预览</el-button>
    <el-dialog v-model="visible" width="90%" append-to-body destroy-on-close>
      <auth-img :authSrc="url" style="height:1000px;" v-if="visible" />
    </el-dialog>
  </div>
</template>

<script setup lang="ts">
import { ref, defineAsyncComponent } from 'vue'
const authImg = defineAsyncComponent(() => import('/@/components/tools/auth-img.vue'))

// Props
defineProps<{
  url: string
}>()

// 对话框显示状态
const visible = ref(false)

// 预览PDF
const handlePdfPreview = () => {
  visible.value = true
}
</script>

<style scoped lang="scss">
</style>
