Skip to content
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

feat(DatePicker): support confirm and getSelectedDate method #12762

Merged
merged 4 commits into from Apr 4, 2024

Conversation

bluesky335
Copy link
Contributor

issue:#12711
为 DatePicker 组件添加了 confirm 方法
为 DatePicker 组件添加了 getSelectedDate 方法


| Name | Description | Attribute | Return value |
| --- | --- | --- | --- |
| confirm | Stop scrolling and emit confirm event | - | - |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs has no return value, but the confirm method has.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know confirm method has no return value..

return pickerRef.value?.confirm();
};

const getSelectedDate = (): Array<string> => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type of getSelectedDate can be inferred by ts, maybe no need to declare the return type.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 89.80%. Comparing base (103b0ba) to head (e51dd95).
Report is 4 commits behind head on main.

❗ Current head e51dd95 differs from pull request most recent head 9ca2054. Consider uploading reports for the commit 9ca2054 to get more accurate results

Files Patch % Lines
packages/vant/src/date-picker/DatePicker.tsx 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12762      +/-   ##
==========================================
+ Coverage   89.76%   89.80%   +0.03%     
==========================================
  Files         257      257              
  Lines        6850     6856       +6     
  Branches     1663     1663              
==========================================
+ Hits         6149     6157       +8     
+ Misses        375      373       -2     
  Partials      326      326              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chenjiahan chenjiahan enabled auto-merge (squash) April 4, 2024 07:15
@chenjiahan chenjiahan merged commit 6713778 into youzan:main Apr 4, 2024
3 checks passed
@chenjiahan chenjiahan changed the title feat(DatePicker): support "confirm" method, support "getSelectedDate"… feat(DatePicker): support confirm and getSelectedDate method Apr 4, 2024
CatsAndMice pushed a commit to CatsAndMice/vant that referenced this pull request Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants