🍀 修复瀑布流不自动自适应

This commit is contained in:
Hunlongyu
2020-11-06 10:02:01 +08:00
committed by buvta
parent 8a72b30f79
commit dce2e36ef0
3 changed files with 37 additions and 5 deletions

View File

@@ -367,6 +367,7 @@ export default {
const key = this.site.key
const type = this.type.tid
const page = this.pagecount
console.log(key, type, page, 'infiniteHandler')
this.statusText = ' '
if (key && page < 1) { // OK资源前几类硬是去不掉
$state.complete()
@@ -561,7 +562,7 @@ export default {
this.searchContents = []
this.show.find = false
if (this.setting.view === 'picture') {
this.$refs.waterfall.refresh()
this.$refs.filmWaterfall.refresh()
}
}
},
@@ -584,6 +585,17 @@ export default {
created () {
this.getAllSites()
this.getAllSearch()
},
mounted () {
window.addEventListener('resize', () => {
if (this.$refs.filmWaterfall && this.view === 'Film') {
this.$refs.filmWaterfall.resize()
this.$refs.filmWaterfall.refresh()
setTimeout(() => {
this.$refs.filmWaterfall.refresh()
}, 500)
}
}, false)
}
}
</script>

View File

@@ -83,7 +83,7 @@
rowPerView: 2,
}
}"
animationEffect="fadeInUp"
animationDuration="0.5s"
backgroundColor="rgba(0, 0, 0, 0)">
<template slot="item" slot-scope="props">
<div class="card">
@@ -313,6 +313,17 @@ export default {
created () {
this.getRecommendations()
this.getViewMode()
},
mounted () {
window.addEventListener('resize', () => {
if (this.$refs.recommandataionsWaterfall && this.view === 'Recommendation') {
this.$refs.recommandataionsWaterfall.resize()
this.$refs.recommandataionsWaterfall.refresh()
setTimeout(() => {
this.$refs.recommandataionsWaterfall.refresh()
}, 500)
}
}, false)
}
}
</script>

View File

@@ -481,12 +481,21 @@ export default {
})
}
},
mounted () {
this.rowDrop()
},
created () {
this.getFavorites()
this.getViewMode()
},
mounted () {
this.rowDrop()
window.addEventListener('resize', () => {
if (this.$refs.starWaterfall && this.view === 'Star') {
this.$refs.starWaterfall.resize()
this.$refs.starWaterfall.refresh()
setTimeout(() => {
this.$refs.starWaterfall.refresh()
}, 500)
}
}, false)
}
}
</script>