mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-04 08:59:40 +08:00
497 B
497 B
自定义渲染
- order: 2
用 dateCellRender
和 monthCellRender
函数来自定义需要渲染的数据。
import { Calendar } from 'antd';
function dateCellRender(value) {
return <div>date</div>;
}
function monthCellRender(value) {
return <div>month</div>;
}
ReactDOM.render(
<Calendar value={new Date('2010-10-10')}
dateCellRender={dateCellRender} monthCellRender={monthCellRender} />
, document.getElementById('components-calendar-demo-custom-render'));