schangxiang@126.com
2025-05-20 e92383f760f42050f55aa032c649814deb3b7752
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<template>
  <BaseDialog
    title="查看"
    v-model="visible"
    width="50%"
    @close="visible = false"
    @confirm="onConfirm"
  >
    <embed
      type="application/pdf"
      style="width: 100%; height: 750px"
      :src="pdfSrc"
    />
  </BaseDialog>
</template>
 
<script lang="ts" setup>
import { computed, onMounted, ref } from 'vue'
import BaseDialog from '@/components/BaseDialog/index.vue'
 
const props = defineProps<{
  modelValue: boolean
  pdfSrc: string
}>()
 
const emit = defineEmits(['update:modelValue'])
 
const pdfSrc = computed(() => {
  return props.pdfSrc
})
 
const visible = computed({
  get() {
    return props.modelValue
  },
  set(v) {
    emit('update:modelValue', v)
  },
})
 
const onConfirm = () => {
  visible.value = false
}
 
onMounted(async () => {})
</script>
 
<style lang="scss" scoped></style>