소스 검색

视频播放列表初始化高度

zq 1 년 전
부모
커밋
d91b773bf5
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/views/book/courseware/preview/components/video/VideoPreview.vue

+ 5 - 1
src/views/book/courseware/preview/components/video/VideoPreview.vue

@@ -68,7 +68,7 @@ export default {
       data: getVideoData(),
       curVideoIndex: 0,
       elementWidth: 0,
-      elementHeight: 139,
+      elementHeight: 0,
       viewTopBottomBtn: false,
       fileLen: 0,
       translateY: 0,
@@ -92,6 +92,10 @@ export default {
             this.elementHeight = ele.clientHeight;
           }
 
+          if (ele.clientHeight <= 0) {
+            this.elementHeight = this.data.minHeight;
+          }
+
           const mainEle = this.$refs.videoArea;
           // 检查元素是否包含已知的类名
           mainEle.classList.forEach((className) => {