瀏覽代碼

优化大小窗切换功能

Tang 2 年之前
父節點
當前提交
dec1a2e691
共有 1 個文件被更改,包括 2 次插入11 次删除
  1. 2 11
      src/pages/course-detail/index.vue

+ 2 - 11
src/pages/course-detail/index.vue

@@ -41,11 +41,11 @@
                     :style="!switchBox && hideBox ? 'display:none;' : ''"
                   >
                     <div v-if="switchPdf.pdf && switchPdf.pdf > 0">
-                      <template> </template>
                       <pdf
                         class="iframe"
                         :src="$tools.splitImgHost(switchPdf.url)"
-                        v-for="i in computedPdf(switchPdf.pdf)"
+                        v-for="i in switchPdf.pdf"
+                        v-show="(!switchBox && i <= 1) || switchBox"
                         :key="i"
                         :page="i"
                         ref="pdf"
@@ -1579,15 +1579,6 @@ export default {
   },
   computed: {
     ...mapGetters(["userInfo"]),
-    computedPdf: function () {
-      return function (array) {
-        if (!this.switchBox) {
-          return 1;
-        } else {
-          return array;
-        }
-      };
-    },
     compyRecommend: function () {
       return function (array) {
         let ary = [];