Parcourir la source

feat: 隐藏讨论区的情况下,幻灯片占据窗口尽可能大的位置

ChenYangfan il y a 6 ans
Parent
commit
e96440c9c5
2 fichiers modifiés avec 12 ajouts et 2 suppressions
  1. 11 1
      src/components/PDF/Pdf.vue
  2. 1 1
      src/components/PDF/PdfViewer.vue

+ 11 - 1
src/components/PDF/Pdf.vue

@@ -1,5 +1,5 @@
 <template>
-  <canvas class="pdf pdf-canvas" id="pdf-canvas"></canvas>
+  <canvas class="pdf pdf-canvas" id="pdf-canvas" :class="showDiscussion ? '' : 'full-size'"></canvas>
 </template>
 
 <script>
@@ -27,6 +27,7 @@ export default {
   computed: {
     ...mapState({
       src: state => state.pdf.src,
+      showDiscussion: state => state.pdf.showDiscussion,
       currentPage: state => state.pdf.currentPage,
       screenShot: state => state.pdf.screenShot
     })
@@ -78,6 +79,12 @@ canvas {
   background-color: white;
 }
 
+.full-size {
+  max-width: 90vw;
+  min-width: unset;
+  max-height: 80vh;
+}
+
 @media (min-width: 1001px) {
   canvas {
     max-width: 58vw;
@@ -99,6 +106,9 @@ canvas {
     min-width: unset;
     max-height: 80vh;
   }
+  .full-size {
+    max-width: 100vw;
+  }
 }
 
 </style>

+ 1 - 1
src/components/PDF/PdfViewer.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <pdf ref="pdf" :class="fullSize ? 'full-size': ''"></pdf>
+    <pdf ref="pdf"></pdf>
     <pdf-controller></pdf-controller>
   </div>
 </template>