-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
[new feature] List 考虑错误情况,增加 error-text
属性 #2567
#2568
[new feature] List 考虑错误情况,增加 error-text
属性 #2567
#2568
Conversation
👍 很棒的功能 提一点小建议,目前 vant 会尽量避免在 i18n 文件中添加新的字段(除非是比较通用的),避免体积膨胀,所以能否把 |
Codecov Report
@@ Coverage Diff @@
## dev #2568 +/- ##
==========================================
- Coverage 87.21% 87.13% -0.09%
==========================================
Files 104 104
Lines 1893 1896 +3
Branches 188 188
==========================================
+ Hits 1651 1652 +1
- Misses 211 213 +2
Partials 31 31
Continue to review full report at Codecov.
|
@chenjiahan 谢谢。我先去掉吧。稍等下 |
@chenjiahan done. |
刚想了一下,控制 error 状态可以考虑使用传入 props 配合 sync 修饰符来做 <van-list :error.sync="error" /> export default {
data() {
error: false
},
methods: {
onLoad() {
ajax().catch(() => {
this.error = true;
})
}
}
} 这样的好处是不依赖传入回调函数,使用者可以更灵活地控制错误状态,你看下是否能完成你的需求~ |
@chenjiahan 请教一下:
|
|
@chenjiahan ci检测说
|
Sorry 是我的失误,已经修复了 |
Merge 了哈~ 会在下个版本发布 |
@chenjiahan 这是我第一次PR,以后有机会多多指教哈 |
哈哈,非常欢迎,期待你的下个 PR~ |
Fixes #2567
Changes you made in this pull request:
props
增加errorText
data
增加error
load
事件增加参数:handleError