From 1e6a98df8897a5d9b9d13ba3650c4c8d247550da Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Sun, 13 Dec 2020 16:08:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=B7=E6=8A=A5=E6=A8=A1=E5=BC=8F=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E5=8A=A0=E4=B8=8Aresize=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Film.vue | 6 +++++- src/components/History.vue | 4 +++- src/components/Recommendation.vue | 4 +++- src/components/Star.vue | 4 +++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/Film.vue b/src/components/Film.vue index 0ba8b98..0371a95 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -872,7 +872,11 @@ export default { }, mounted () { window.addEventListener('resize', () => { - setTimeout(() => { this.showTableLastColumn = window.outerWidth >= 1200 }, 100) + setTimeout(() => { + this.showTableLastColumn = window.outerWidth >= 1200 + if (this.$refs.filmWaterfall) this.$refs.filmWaterfall.resize() + if (this.$refs.filmSearchWaterfall) this.$refs.filmSearchWaterfall.resize() + }, 100) }, true) } } diff --git a/src/components/History.vue b/src/components/History.vue index e230c21..9cc75ef 100644 --- a/src/components/History.vue +++ b/src/components/History.vue @@ -323,7 +323,9 @@ export default { } }, mounted () { - window.addEventListener('resize', () => { }, true) + window.addEventListener('resize', () => { + setTimeout(() => { if (this.$refs.historyWaterfall) this.$refs.historyWaterfall.resize() }, 100) + }, true) }, created () { this.getAllhistory() diff --git a/src/components/Recommendation.vue b/src/components/Recommendation.vue index 0eb1a89..900ea44 100644 --- a/src/components/Recommendation.vue +++ b/src/components/Recommendation.vue @@ -330,7 +330,9 @@ export default { this.getRecommendations() }, mounted () { - window.addEventListener('resize', () => { }, true) + window.addEventListener('resize', () => { + setTimeout(() => { if (this.$refs.recommendataionsWaterfall) this.$refs.recommendataionsWaterfall.resize() }, 100) + }, true) } } diff --git a/src/components/Star.vue b/src/components/Star.vue index 82b333d..3e9ef6f 100644 --- a/src/components/Star.vue +++ b/src/components/Star.vue @@ -475,7 +475,9 @@ export default { this.getFavorites() }, mounted () { - window.addEventListener('resize', () => { }, true) + window.addEventListener('resize', () => { + setTimeout(() => { if (this.$refs.starWaterfall) this.$refs.starWaterfall.resize() }, 100) + }, true) } }