-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
type(list): If loadingText is set to null, hidden the loading comp #13440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13440 +/- ##
==========================================
+ Coverage 89.60% 89.67% +0.07%
==========================================
Files 257 257
Lines 7013 7034 +21
Branches 1736 1742 +6
==========================================
+ Hits 6284 6308 +24
+ Misses 384 383 -1
+ Partials 345 343 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
packages/vant/src/list/List.tsx
Outdated
if (slots.loading) { | ||
return <div class={bem('loading')}>{slots.loading()}</div>; | ||
} | ||
const text = props.loadingText ?? t('loading'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议允许传入 null,并在值为 null 的时候不展示 loading,这样可以避免 break 现有的项目
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参考
vant/packages/vant/src/checkbox/Checker.tsx
Lines 48 to 52 in e343c7a
indeterminate: { | |
type: Boolean as PropType<boolean | null>, | |
default: null, | |
}, | |
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我之所以这样写,是因为finished-text=""
能达到不显示加载完毕的提示,想着他们俩应该尽量统一,避免认知错乱。
所以,仍然按上面要求的改吗?佬。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
抱歉回复晚了,我还是倾向于尽可能不破坏现有的行为,所以新增一个 null 是比较合适的选择
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
094f197
to
fbbc7fd
Compare
允许
loadingText
设置为null, 不显示loading效果