首页切换导航bug修复

This commit is contained in:
冯辉
2025-10-24 17:37:38 +08:00
parent 12906b65ec
commit 5a31d56c9a
2 changed files with 10 additions and 2 deletions

View File

@@ -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) {