ant-design/components/calendar/demo/custom-render.md
2015-11-13 20:32:54 +08:00

497 B

自定义渲染

  • order: 2

dateCellRendermonthCellRender 函数来自定义需要渲染的数据。


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'));