From 5a31d56c9ac3db4fe37a52f957315000a1c386be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E8=BE=89?= <13935151924@163.com> Date: Fri, 24 Oct 2025 17:37:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=88=87=E6=8D=A2=E5=AF=BC?= =?UTF-8?q?=E8=88=AAbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/components/index-one.vue | 4 +++- .../custom-waterfalls-flow/custom-waterfalls-flow.vue | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pages/index/components/index-one.vue b/pages/index/components/index-one.vue index f4ae5a3..8d6a2bb 100644 --- a/pages/index/components/index-one.vue +++ b/pages/index/components/index-one.vue @@ -678,7 +678,9 @@ async function loadData() { } function scrollBottom() { - loadmoreRef.value.change('loading'); + if (loadmoreRef.value && typeof loadmoreRef.value.change === 'function') { + loadmoreRef.value.change('loading'); + } if (state.tabIndex === 'all') { getJobRecommend(); } else { diff --git a/uni_modules/custom-waterfalls-flow/components/custom-waterfalls-flow/custom-waterfalls-flow.vue b/uni_modules/custom-waterfalls-flow/components/custom-waterfalls-flow/custom-waterfalls-flow.vue index 2b18e1a..c4eb37c 100644 --- a/uni_modules/custom-waterfalls-flow/components/custom-waterfalls-flow/custom-waterfalls-flow.vue +++ b/uni_modules/custom-waterfalls-flow/components/custom-waterfalls-flow/custom-waterfalls-flow.vue @@ -229,7 +229,13 @@ export default { query .select(`#waterfalls_flow_column_${i}`) .boundingClientRect((data) => { - heightArr.push({ column: i, height: data.height }); + // 添加 null 检查,防止 data 为 null 时访问 height 属性 + if (data && data.height !== undefined) { + heightArr.push({ column: i, height: data.height }); + } else { + // 如果元素不存在或高度未定义,使用默认高度 0 + heightArr.push({ column: i, height: 0 }); + } }) .exec(() => { if (this.data.column <= heightArr.length) {