mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-24 07:28:28 +08:00
cbf2242065
* docs: more and more * chore: bump rc-picker * test: update snapshot * chore: multiple style * chore: fix removeIcon * test: update snapshot * test: update testcase * test: update snapshot * chore: cleanup
34 lines
871 B
TypeScript
34 lines
871 B
TypeScript
import React from 'react';
|
|
import type { DatePickerProps } from 'antd';
|
|
import { DatePicker, Flex } from 'antd';
|
|
import dayjs from 'dayjs';
|
|
import type { Dayjs } from 'dayjs';
|
|
|
|
const onChange: DatePickerProps<Dayjs[]>['onChange'] = (date, dateString) => {
|
|
console.log(date, dateString);
|
|
};
|
|
|
|
const defaultValue = [dayjs('2000-01-01'), dayjs('2000-01-03'), dayjs('2000-01-05')];
|
|
|
|
const App: React.FC = () => (
|
|
<Flex vertical gap="small">
|
|
<DatePicker
|
|
multiple
|
|
onChange={onChange}
|
|
maxTagCount="responsive"
|
|
defaultValue={defaultValue}
|
|
size="small"
|
|
/>
|
|
<DatePicker multiple onChange={onChange} maxTagCount="responsive" defaultValue={defaultValue} />
|
|
<DatePicker
|
|
multiple
|
|
onChange={onChange}
|
|
maxTagCount="responsive"
|
|
defaultValue={defaultValue}
|
|
size="large"
|
|
/>
|
|
</Flex>
|
|
);
|
|
|
|
export default App;
|