|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <hc-pdf v-if="isPdfDom" :src="pdfUrl" :download="isDownload" :print="isPrint" :is-https="isHttps" />
|
|
|
+ <hc-pdf v-if="isPdfDom" :src="pdfUrl" :download="isDownload" :print="isPrint" :is-https="isHttps" :file-name="fileName" />
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
@@ -17,6 +17,10 @@ const props = defineProps({
|
|
|
type: String,
|
|
|
default: '',
|
|
|
},
|
|
|
+ fileName: {
|
|
|
+ type: String,
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
})
|
|
|
|
|
|
defineOptions({
|
|
@@ -26,9 +30,12 @@ defineOptions({
|
|
|
//监听
|
|
|
const queryUrl = ref(props.url)
|
|
|
const queryCode = ref(props.code)
|
|
|
-watch(() => [props.url, props.code], ([url, code]) => {
|
|
|
+const fileName = ref(props.fileName)
|
|
|
+watch(() => [props.url, props.code, props.fileName], ([url, code, name]) => {
|
|
|
+
|
|
|
queryUrl.value = url
|
|
|
queryCode.value = code
|
|
|
+ fileName.value = name
|
|
|
setPdfSrcData()
|
|
|
})
|
|
|
|