datetime-picker添加年选择器#241
Merged
Moonofweisheng merged 7 commits intoMoonofweisheng:masterfrom Apr 13, 2024
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for wot-design-uni ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Moonofweisheng
requested changes
Apr 13, 2024
Owner
Moonofweisheng
left a comment
There was a problem hiding this comment.
非常感谢你的PR,很有帮助,这里有2点需要调整后才方便合并:
- year类型时
picker-view的getValues和getSelects的返回值并非数组类型,之前的逻辑中对其类型断言为数组类型,在year类型下就不适用了(as xx[] 可以移除),所以希望在使用其返回值时做个类型判断,如果不是数组则将其作为第一项放在数组中,用于兼容updateInnerValue和defaultDisplayFormat要求入参是数组类型的问题。 - 有一段打印代码提交上来了,也希望移除(console.log('items.length', items.length))
Moonofweisheng
requested changes
Apr 13, 2024
Owner
Moonofweisheng
left a comment
There was a problem hiding this comment.
首先再次感谢,这里有个再次调整的建议:
updateInnerValue方法这一行const year = type === 'year' ? values : values[0] && parseInt(values[0])中values始终为数组类型,而year则要求不为数组,这里可以仍然使用原来的逻辑对year赋值const year = values[0] && parseInt(values[0])。而对数组类型的判断可以使用util中提供的isArray方法,它可以实现类型推导。
Moonofweisheng
approved these changes
Apr 13, 2024
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.
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
resolve #125
💡 需求背景和解决方案
☑️ 请求合并前的自查清单