Quellcode durchsuchen

pdf预览加关闭按钮

duy vor 1 Jahr
Ursprung
Commit
762a20132c
1 geänderte Dateien mit 9 neuen und 0 gelöschten Zeilen
  1. 9 0
      src/views/home/pdf.vue

+ 9 - 0
src/views/home/pdf.vue

@@ -1,5 +1,10 @@
 <template>
     <hc-new-card>
+        <template #extra>
+            <el-button type="primary" @click="goBack">
+                关闭
+            </el-button>
+        </template>
         <hc-pdf :src="pdfUrl" :download="isDownload" :print="isPrint" />
     </hc-new-card>
 </template>
@@ -9,6 +14,7 @@ import { isNullES } from 'js-fast-way'
 import { onActivated, ref } from 'vue'
 import { useRoute } from 'vue-router'
 import { btnAuth, decode } from '~uti/btn-auth'
+import router from '~src/router/index'
 
 //初始变量
 const useRoutes = useRoute()
@@ -40,4 +46,7 @@ onActivated(() => {
     //两个都有的情况下,以code为准
     pdfUrl.value = decode(code ?? '')
 })
+const goBack = ()=>{
+    router.back()
+}
 </script>