Sunny-Kid / antd-extensions

一个ant.design的react扩展组件库

Home Page:https://dfocusfe.github.io/antd-extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

antd-extensions

NPM version

Install

npm install --save antd-extensions

ant-design的 DFocus 扩展组件库,帮助开发者选择需要的组件,并迅速进入角色。

完整 API 使用文档,请这边走

Usage

// 日期区间选择器
import React, { Component } from 'react'
import { TimeRangePicker } from 'antd-extensions'

class Example extends Component {
  constructor(props) {
    super(props)

    this.state = {
      value: {
        type: 'CUSTOMIZE',
        ranges: [1533081600000, 1534377600000]
      }
    }
  }

  _handleChange = value => {
    console.log(`You're selection is ${JSON.stringify(value)}`)
    this.setState({
      value
    })
  }

  render() {
    return (
      <TimeRangePicker
        value={this.state.value}
        onChange={this._handleChange}
        labels={{
          BTN_ALL: 'All',
          BTN_LAST_WEEK: 'Last week',
          BTN_LAST_MONTH: 'Last month',
          BTN_CUSTOMIZE: 'Customize',
          PLACEHOLDER_START: 'Start',
          PLACEHOLDER_END: 'End'
        }}
        disabledDate={current =>
          current &&
          current >
            moment()
              .endOf('day')
              .subtract(1, 'days')
        }
      />
    )
  }
}

LICENSE

MIT License

About

一个ant.design的react扩展组件库

https://dfocusfe.github.io/antd-extensions

License:MIT License


Languages

Language:JavaScript 98.5%Language:HTML 0.9%Language:CSS 0.7%