From 1cf6d9fb8cf2f10e302509f033d8d55b4e60712c Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Sun, 14 Aug 2022 01:45:42 +0800 Subject: [PATCH] 优化友链布局,月台窗口自适应,处理hls取消后仍然缓存问题 --- src/components/group/MyVideo.vue | 31 ++++++++++++++++++++++++++++--- 1 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/components/group/MyVideo.vue b/src/components/group/MyVideo.vue index 17fc80c..c04e931 100644 --- a/src/components/group/MyVideo.vue +++ b/src/components/group/MyVideo.vue @@ -1,10 +1,11 @@ <template> <div class="myModal"> - <a-modal v-model="visible" title="视频盒子" :footer="null" :mask="false" :maskClosable="true" - :bodyStyle="{'overflow':'overlay','maxHeight': '750px'}" :afterClose="afterClose"> - <videoDetail ref="videoDetail"></videoDetail> + <a-modal v-model="visible" title="视频盒子" :width="myWidth" :footer="null" :mask="false" :maskClosable="true" + :bodyStyle="{'overflow':'overlay','height': '750px'}" :afterClose="afterClose" > + <videoDetail ref="videoDetail" :showFade="showFade"></videoDetail> </a-modal> </div> + </template> <script> @@ -13,6 +14,14 @@ export default { components: { videoDetail, + }, + mounted() { + this.juseWidth(document.body.clientWidth) + window.onresize = () => { + return (() => { + this.juseWidth(document.body.clientWidth) + })(); + }; }, watch: { // '$route'(to, from) { @@ -36,9 +45,22 @@ return { visible: false, articleId: "", + myWidth: 410, + showFade: true, } }, methods: { + juseWidth(screenWidth) { + this.showFade = true; + if (screenWidth > 1000) { + this.myWidth = 1000 + } else if (screenWidth > 767) { + this.myWidth = 600 + } else { + this.myWidth = 410 + this.showFade = false; + } + }, showModal(param) { this.visible = true; this.$nextTick(function() { @@ -56,4 +78,7 @@ </script> <style scoped> + + + </style> -- Gitblit v1.9.1