mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-13 07:39:10 +08:00
07d5e5e7bb
* feat: rename calendar token * docs: add component-token demo
30 lines
763 B
TypeScript
30 lines
763 B
TypeScript
import { Calendar, ConfigProvider } from 'antd';
|
|
import type { CalendarMode } from 'antd/es/calendar/generateCalendar';
|
|
import type { Dayjs } from 'dayjs';
|
|
import React from 'react';
|
|
|
|
/** Test usage. Do not use in your production. */
|
|
export default () => {
|
|
const onPanelChange = (value: Dayjs, mode: CalendarMode) => {
|
|
console.log(value.format('YYYY-MM-DD'), mode);
|
|
};
|
|
|
|
return (
|
|
<ConfigProvider
|
|
theme={{
|
|
components: {
|
|
Calendar: {
|
|
fullBg: 'red',
|
|
fullPanelBg: 'green',
|
|
itemActiveBg: 'black',
|
|
},
|
|
},
|
|
}}
|
|
>
|
|
<Calendar onPanelChange={onPanelChange} />
|
|
<br />
|
|
<Calendar onPanelChange={onPanelChange} fullscreen={false} />
|
|
</ConfigProvider>
|
|
);
|
|
};
|