From a9011abdf0feef81d7f37e05ddadb49066b0a0b9 Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Mon, 9 Nov 2020 18:31:19 +0100 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5Waterfall=E5=85=83=E7=B4=A0?= =?UTF-8?q?=E7=9A=84null=20check?= 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, 13 insertions(+), 5 deletions(-) diff --git a/src/components/Film.vue b/src/components/Film.vue index 9f5909e..93ae7ec 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -485,7 +485,9 @@ export default { if (this.view === 'Film') { this.getAllSites() if (this.setting.view === 'picture') { - this.$refs.filmWaterfall.refresh() + if (this.$refs.filmWaterfall) { + this.$refs.filmWaterfall.refresh() + } this.getPage().then(() => { this.infiniteId += 1 }) @@ -567,7 +569,7 @@ export default { this.show.class = true this.searchContents = [] this.show.find = false - if (this.setting.view === 'picture') { + if (this.setting.view === 'picture' && this.$refs.filmWaterfall) { this.$refs.filmWaterfall.refresh() } } diff --git a/src/components/History.vue b/src/components/History.vue index 1b33d9e..ff8344e 100644 --- a/src/components/History.vue +++ b/src/components/History.vue @@ -156,7 +156,9 @@ export default { view () { this.getAllhistory() this.getAllsites() - this.$refs.historyWaterfall.refresh() + if (this.$refs.historyWaterfall) { + this.$refs.historyWaterfall.refresh() + } } }, methods: { diff --git a/src/components/Recommendation.vue b/src/components/Recommendation.vue index 74a3e27..c929055 100644 --- a/src/components/Recommendation.vue +++ b/src/components/Recommendation.vue @@ -197,7 +197,9 @@ export default { view () { if (this.view === 'Recommendation') { this.getRecommendations() - this.$refs.recommendataionsWaterfall.refresh() + if (this.$refs.recommendataionsWaterfall) { + this.$refs.recommendataionsWaterfall.refresh() + } } }, sortKeyword () { diff --git a/src/components/Star.vue b/src/components/Star.vue index 27ccedf..555cc0c 100644 --- a/src/components/Star.vue +++ b/src/components/Star.vue @@ -192,7 +192,9 @@ export default { if (this.view === 'Star') { this.getAllsites() this.getFavorites() - this.$refs.starWaterfall.refresh() + if (this.$refs.starWaterfall) { + this.$refs.starWaterfall.refresh() + } } }, numNoUpdate () {