ant-design/components/calendar/demo/fullscreen.md

50 lines
1.3 KiB
Markdown
Raw Normal View History

2015-11-11 00:15:12 +08:00
# 全屏
- order: 3
变大
---
````jsx
import { Calendar } from 'antd';
function getDateData(value) {
2015-11-11 14:32:58 +08:00
let listData;
2015-11-11 00:15:12 +08:00
switch (value.getDayOfMonth()) {
case 8:
2015-11-11 14:32:58 +08:00
listData = [
2015-11-11 00:15:12 +08:00
{ type: 'warn', content: '这里是警告事项.' },
{ type: 'normal', content: '这里是普通事项.' }
]; break;
case 10:
2015-11-11 14:32:58 +08:00
listData = [
2015-11-11 00:15:12 +08:00
{ type: 'warn', content: '这里是警告事项.' },
{ type: 'normal', content: '这里是普通事项.' },
{ type: 'error', content: '这里是错误事项.' }
]; break;
case 15:
2015-11-11 14:32:58 +08:00
listData = [
2015-11-11 00:15:12 +08:00
{ type: 'warn', content: '这里是警告事项.' },
2015-11-12 21:24:53 +08:00
{ type: 'normal', content: '这里是普通事项好长啊。。....' },
{ type: 'error', content: '这里是错误事项.' },
{ type: 'error', content: '这里是错误事项.' },
2015-11-11 00:15:12 +08:00
{ type: 'error', content: '这里是错误事项.' },
{ type: 'error', content: '这里是错误事项.' }
]; break;
}
2015-11-11 14:32:58 +08:00
return listData;
2015-11-11 00:15:12 +08:00
}
function getMonthData(value) {
if (value.getMonth() === 8) {
return 1394;
}
return 0;
}
ReactDOM.render(
2015-11-12 21:24:53 +08:00
<Calendar fullscreen={true} type={'date'} getDateData={getDateData} getMonthData={getMonthData} />
2015-11-11 00:15:12 +08:00
, document.getElementById('components-calendar-demo-fullscreen'));
````