Explorar o código

优化大小窗切换功能

Tang %!s(int64=2) %!d(string=hai) anos
pai
achega
dec1a2e691
Modificáronse 1 ficheiros con 2 adicións e 11 borrados
  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 = [];