Category - Ant-Design-React

2019-11-14 15:46:48    7    0    0
## 勾选 ``` import React,{ Component } from 'react'; import { Table,Icon,Divider } from 'antd'; let data = [{ key: 1, name: '花骨朵', age: 18, hobby: '看书', },{ key: 2, name: '天下',
2019-11-14 15:46:48    10    0    0
### antd最新版可以使用next(), prev(), goTo() ### antd旧版使用refs.slick.slickNext(), refs.slick.slickPrev(), refs.slick.slickGoTo() next = ()=> { this.carouselRef.refs.slick.slickNext(); } p
2019-11-14 15:46:48    10    0    0
### 高度样式 this.setState({ showInfoDetail: false, protocolInfo: null })} footer={[ , ]} >
2019-11-14 15:46:48    6    0    0
> https://ant.design/docs/react/recommendation-cn
2019-11-14 15:46:48    5    0    0

只能选今天或者今天以后的日期

  1. disabledDate = (current) => {
  2. return current && current < moment().startOf('day').subtract(0, 'days');
  3. }

只能选今天或者今天以后的小时

  1. disabledRangeTime = (_, type) => {
  2. const { form: { getFieldValue } } = this.props
  3. if (type === 'start') {
  4. const nowHours = moment().hours()
  5. const time = getFieldValue("time")
  6. if (time && moment(time[0].format("YYYY-MM-DD")).valueOf() <= moment(moment().format("YYYY-MM-DD")).valueOf()) {
  7. return {
  8. disabledHours: () => this.range(0, nowHours),
  9. };
  10. }
  11. }
  12. }

在关闭选择时间面板的时候判断是否小于(当前时间 + 10s)

  1. onOpenChange = (status) => {
  2. const { form: { getFieldValue, setFields } } = this.props
  3. const time = getFieldValue("time")
  4. if (!status) {
  5. if (time && (moment(time[0]).valueOf() + 10000) < moment().valueOf()) {
  6. setFields({
  7. time: {
  8. value: null,
  9. errors: [n