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(Calendar): add click-disabled-date event #12274

Merged

Conversation

LadyChatterleyLover
Copy link
Contributor

解决问题: 日历组件新增 click-disabled-date 事件
相关issue: #12247

@codecov-commenter
Copy link

Codecov Report

Patch coverage is 100.00% of modified lines.

Files Changed Coverage
packages/vant/src/calendar/Calendar.tsx 100.00%
packages/vant/src/calendar/CalendarDay.tsx 100.00%
packages/vant/src/calendar/CalendarMonth.tsx 100.00%

📢 Thoughts on this report? Let us know!.

@@ -116,6 +116,7 @@ export default defineComponent({
'overRange',
'update:show',
'clickSubtitle',
'click-disabled-date',
Copy link
Member

Choose a reason for hiding this comment

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

eventName 统一使用驼峰格式哈

@@ -64,6 +64,8 @@ export default defineComponent({
const onClick = () => {
if (props.item.type !== 'disabled') {
emit('click', props.item);
} else {
emit('click-disabled-date', props.item);
Copy link
Member

Choose a reason for hiding this comment

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

能否补充一个单元测试~

@LadyChatterleyLover
Copy link
Contributor Author

LadyChatterleyLover commented Sep 11, 2023 via email

@LadyChatterleyLover
Copy link
Contributor Author

LadyChatterleyLover commented Sep 11, 2023 via email

@LadyChatterleyLover
Copy link
Contributor Author

LadyChatterleyLover commented Sep 12, 2023 via email

@chenjiahan chenjiahan merged commit 9ffacac into youzan:main Sep 13, 2023
3 checks passed
@chenjiahan
Copy link
Member

👍🏻👍🏻

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

3 participants