From 14764dd7679369a650ad1d60be62aacc863755a1 Mon Sep 17 00:00:00 2001 From: tj <1378534974@qq.com> Date: 星期四, 22 五月 2025 16:29:01 +0800 Subject: [PATCH] 3 --- sub-pages/film-list/film-list.vue | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sub-pages/film-list/film-list.vue b/sub-pages/film-list/film-list.vue index 741f665..6baa20d 100644 --- a/sub-pages/film-list/film-list.vue +++ b/sub-pages/film-list/film-list.vue @@ -53,7 +53,6 @@ import WaterfallCol from '@/uni_modules/helang-waterfall/components/waterfall/waterfall-col'; import WaterfallItem from '@/uni_modules/helang-waterfall/components/waterfall/waterfall-item'; - export default { components: { Waterfall, @@ -133,12 +132,19 @@ console.log("theme", uni.getStorageSync('theme')) const theme = uni.getStorageSync('theme') || 'light' this.theme = theme - - this.$refs.helangWaterfall.render(this.items, true); + }, + onShow() { + this.$nextTick(() => { + this.$refs.helangWaterfall?.render(this.items, true); + }); + }, + onUnload() { + if (this.$refs.helangWaterfall?.clear) { + this.$refs.helangWaterfall.clear(); + } }, methods: { onSearch(value) { - debugger; uni.showToast({ title: `搜索:${value}`, icon: 'none' @@ -158,12 +164,14 @@ }, onRenderHeight({ colIndex, height, reportHeightTimeChange }) { + console.log("height:", height) this.$refs.helangWaterfall.reportHeight({ colIndex, height, reportHeightTimeChange }) }, + } } </script> -- Gitblit v1.9.3