-
Notifications
You must be signed in to change notification settings - Fork 144
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
datetime-picker添加年选择器 #241
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. |
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.
非常感谢你的PR,很有帮助,这里有2点需要调整后才方便合并:
- year类型时
picker-view
的getValues
和getSelects
的返回值并非数组类型,之前的逻辑中对其类型断言为数组类型,在year
类型下就不适用了(as xx[] 可以移除),所以希望在使用其返回值时做个类型判断,如果不是数组则将其作为第一项放在数组中,用于兼容updateInnerValue和defaultDisplayFormat要求入参是数组类型的问题。 - 有一段打印代码提交上来了,也希望移除(console.log('items.length', items.length))
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.
首先再次感谢,这里有个再次调整的建议:
updateInnerValue
方法这一行const year = type === 'year' ? values : values[0] && parseInt(values[0])
中values始终为数组类型,而year则要求不为数组,这里可以仍然使用原来的逻辑对year赋值const year = values[0] && parseInt(values[0])
。而对数组类型的判断可以使用util中提供的isArray
方法,它可以实现类型推导。
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
resolve #125
💡 需求背景和解决方案
☑️ 请求合并前的自查清单