mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-01 23:29:30 +08:00
45 lines
1.0 KiB
Markdown
45 lines
1.0 KiB
Markdown
# 基本
|
|
|
|
- order: 0
|
|
|
|
最简单的用法。
|
|
|
|
---
|
|
|
|
````jsx
|
|
import { Calendar } from 'antd';
|
|
|
|
function getDateData(value) {
|
|
|
|
let listdata;
|
|
switch (value.getDayOfMonth()) {
|
|
case 8:
|
|
listdata = [
|
|
{ type: 'warn', content: '这里是警告事项.' },
|
|
{ type: 'normal', content: '这里是普通事项.' }
|
|
]; break;
|
|
case 10:
|
|
listdata = [
|
|
{ type: 'warn', content: '这里是警告事项.' },
|
|
{ type: 'normal', content: '这里是普通事项.' },
|
|
{ type: 'error', content: '这里是错误事项.' }
|
|
]; break;
|
|
case 15:
|
|
listdata = [
|
|
{ type: 'warn', content: '这里是警告事项.' },
|
|
{ type: 'normal', content: '这里是普通事项.' },
|
|
{ type: 'error', content: '这里是错误事项.' },
|
|
{ type: 'error', content: '这里是错误事项.' }
|
|
]; break;
|
|
}
|
|
|
|
return listdata;
|
|
|
|
}
|
|
|
|
|
|
ReactDOM.render(
|
|
<Calendar getDateData={getDateData} />
|
|
, document.getElementById('components-calendar-demo-basic'));
|
|
````
|