[new feature] List 考虑错误情况,增加 error-text 属性 #2567#2568
Merged
chenjiahan merged 7 commits intoyouzan:devfrom Jan 20, 2019
Merged
Conversation
Member
|
👍 很棒的功能 提一点小建议,目前 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.
|
Contributor
Author
|
@chenjiahan 谢谢。我先去掉吧。稍等下 |
Contributor
Author
|
@chenjiahan done. |
Member
|
刚想了一下,控制 error 状态可以考虑使用传入 props 配合 sync 修饰符来做 <van-list :error.sync="error" />export default {
data() {
error: false
},
methods: {
onLoad() {
ajax().catch(() => {
this.error = true;
})
}
}
}这样的好处是不依赖传入回调函数,使用者可以更灵活地控制错误状态,你看下是否能完成你的需求~ |
Contributor
Author
|
@chenjiahan 请教一下:
|
Member
|
Contributor
Author
|
@chenjiahan ci检测说 |
Member
|
Sorry 是我的失误,已经修复了 |
Member
|
Merge 了哈~ 会在下个版本发布 |
Contributor
Author
|
@chenjiahan 这是我第一次PR,以后有机会多多指教哈 |
Member
|
哈哈,非常欢迎,期待你的下个 PR~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2567
Changes you made in this pull request:
props增加errorTextdata增加errorload事件增加参数:handleError