Przeglądaj źródła

pdf预览页面加关闭按钮

duy 1 rok temu
rodzic
commit
9c97a8d7f6
1 zmienionych plików z 10 dodań i 0 usunięć
  1. 10 0
      src/views/home/pdf.vue

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

@@ -1,5 +1,11 @@
 <template>
     <hc-new-card>
+        <template #extra>
+            <el-button type="primary" @click="goBack">
+                <HcIcon name="close" />
+                关闭
+            </el-button>
+        </template>
         <hc-pdf :src="pdfUrl" :download="isDownload" :print="isPrint" />
     </hc-new-card>
 </template>
@@ -9,6 +15,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 +47,7 @@ onActivated(() => {
     //两个都有的情况下,以code为准
     pdfUrl.value = decode(code ?? '')
 })
+const goBack = ()=>{
+    router.back()
+}
 </script>