mirror of https://github.com/ElemeFE/element
* DatePicker: add onPick option, close #2921 * DatePicker: fix typopull/3720/head
parent
8359db6d25
commit
8f9b473911
|
@ -269,6 +269,7 @@ Picking a date range is supported.
|
|||
| shortcuts | a { text, onClick } object array to set shortcut options, check the table below | object[] | — | — |
|
||||
| disabledDate | a function determining if a date is disabled with that date as its parameter. Should return a Boolean | function | — | — |
|
||||
| firstDayOfWeek | first day of week | Number | 1 to 7 | 7 |
|
||||
| onPick | a callback that triggers when the seleted date is changed. Only for `daterange` and `datetimerange`. | Function({ maxDate, minDate }) | - | - |
|
||||
|
||||
### shortcuts
|
||||
| Attribute | Description | Type | Accepted Values | Default |
|
||||
|
|
|
@ -303,6 +303,7 @@
|
|||
| shortcuts | 设置快捷选项,需要传入 { text, onClick } 对象用法参考 demo 或下表 | Object[] | — | — |
|
||||
| disabledDate | 设置禁用状态,参数为当前日期,要求返回 Boolean | Function | — | — |
|
||||
| firstDayOfWeek | 周起始日 | Number | 1 到 7 | 7 |
|
||||
| onPick | 选中日期后会执行的回调,只有当 `daterange` 或 `datetimerange` 才生效 | Function({ maxDate, minDate }) | - | - |
|
||||
|
||||
### Shortcuts
|
||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||
|
|
|
@ -377,9 +377,9 @@
|
|||
if (this.maxDate === val.maxDate && this.minDate === val.minDate) {
|
||||
return;
|
||||
}
|
||||
this.onPick && this.onPick(val);
|
||||
this.maxDate = val.maxDate;
|
||||
this.minDate = val.minDate;
|
||||
|
||||
if (!close || this.showTime) return;
|
||||
this.handleConfirm();
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue