mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 11:07:52 +08:00
属性存在判断修改
This commit is contained in:
parent
f539b1d8e4
commit
6800339e97
@ -1016,7 +1016,7 @@ export class DatePicker extends React.Component<DateProps, DatePickerState> {
|
||||
if (typeof item === 'string') {
|
||||
shortcut = this.getAvailableShortcuts(item);
|
||||
shortcut.key = item;
|
||||
} else if ('date' in item) {
|
||||
} else if (item.date) {
|
||||
shortcut = {
|
||||
...item,
|
||||
date: () => item.date
|
||||
|
@ -235,7 +235,6 @@ export class DateRangePicker extends React.Component<
|
||||
this.handleClick = this.handleClick.bind(this);
|
||||
this.handleKeyPress = this.handleKeyPress.bind(this);
|
||||
this.handlePopOverClick = this.handlePopOverClick.bind(this);
|
||||
this.renderRanges = this.renderRanges.bind(this);
|
||||
const {format, joinValues, delimiter, value} = this.props;
|
||||
|
||||
this.state = {
|
||||
@ -384,7 +383,7 @@ export class DateRangePicker extends React.Component<
|
||||
if (typeof item === 'string') {
|
||||
range = availableRanges[item];
|
||||
range.key = item;
|
||||
} else if ('endDate' in item && 'startDate' in item) {
|
||||
} else if (item.startDate && item.endDate) {
|
||||
range = {
|
||||
...item,
|
||||
startDate: () => item.startDate,
|
||||
|
Loading…
Reference in New Issue
Block a user