mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 01:19:45 +08:00
f1c38bf9e0
* feat: update demo * feat: update demo * feat: update demo * feat: update demo * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code
27 lines
660 B
TypeScript
27 lines
660 B
TypeScript
import type { Dayjs } from 'dayjs';
|
|
import React from 'react';
|
|
import { Calendar, theme } from 'antd';
|
|
import type { CalendarProps } from 'antd';
|
|
|
|
const onPanelChange = (value: Dayjs, mode: CalendarProps<Dayjs>['mode']) => {
|
|
console.log(value.format('YYYY-MM-DD'), mode);
|
|
};
|
|
|
|
const App: React.FC = () => {
|
|
const { token } = theme.useToken();
|
|
|
|
const wrapperStyle: React.CSSProperties = {
|
|
width: 300,
|
|
border: `1px solid ${token.colorBorderSecondary}`,
|
|
borderRadius: token.borderRadiusLG,
|
|
};
|
|
|
|
return (
|
|
<div style={wrapperStyle}>
|
|
<Calendar fullscreen={false} onPanelChange={onPanelChange} />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default App;
|