refactor(components-diy): simplify useScroll logic and add comment

将useScroll方法的判断逻辑简化为单行表达式,并补充注释说明该方法的作用
This commit is contained in:
2026-07-15 15:39:08 +08:00
parent 1c88bcf99b
commit 82f1659649

View File

@@ -379,12 +379,9 @@ export default {
const v = this.value || {}; const v = this.value || {};
return v.scrollMode || 'vertical'; return v.scrollMode || 'vertical';
}, },
// 是否使用滚动模式
useScroll() { useScroll() {
if (this.scrollMode === 'none') return false; return this.scrollMode !== 'none' && this.list.length > 1;
if (this.list.length <= 1) return false;
// 华为快应用 WebView 强制走非滚动分支
if (this.$util.isHarmonyQuickAppWebview) return false;
return true;
}, },
// 安全的 display-multiple-items(避免窗口高度 > 内容高度时出现空白) // 安全的 display-multiple-items(避免窗口高度 > 内容高度时出现空白)
safeDisplayMultipleItems() { safeDisplayMultipleItems() {