Skip to content

Commit e0fca91

Browse files
authored
feat: ✨ Calendar 确认事件 confirm 增加 type 参数
1 parent 03623f4 commit e0fca91

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

docs/component/calendar.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -450,13 +450,14 @@ function handleConfirm({ value }) {
450450

451451
## Events
452452

453-
| 事件名称 | 说明 | 参数 | 最低版本 |
454-
| -------- | -------------------------- | ----------- | -------- |
455-
| confirm | 绑定值变化时触发 | `{ value }` | - |
456-
| change | 点击面板日期时触发 | `{ value }` | - |
457-
| cancel | 点击关闭按钮或者蒙层时触发 | - | - |
453+
| 事件名称 | 说明 | 参数 | 最低版本 |
454+
| -------- | ------------------------------------ | ------------------------ | -------- |
455+
| confirm | 绑定值变化时触发 | `{ value, type }` | - |
456+
| change | 点击面板日期时触发 | `{ value }` | - |
457+
| cancel | 点击关闭按钮或者蒙层时触发 | - | - |
458458
| open | 日历打开时触发 | - | - |
459459

460+
460461
## Methods
461462

462463
| 方法名称 | 说明 | 参数 | 最低版本 |

src/uni_modules/wot-design-uni/components/wd-calendar/wd-calendar.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@ function onConfirm() {
411411
lastCurrentType.value = currentType.value
412412
emit('update:modelValue', calendarValue.value)
413413
emit('confirm', {
414-
value: calendarValue.value
414+
value: calendarValue.value,
415+
type: currentType.value
415416
})
416417
}
417418

0 commit comments

Comments
 (0)