@feizheng/react-ant-select

1.1.0 • Public • Published

react-ant-select

React ant select builder.

version license size download

installation

npm install -S @feizheng/react-ant-select

update

npm update @feizheng/react-ant-select

properties

Name Type Required Default Description
className string false - The extended className for component.
value object false - Default value.
placeholder string false '请选择' Placeholder.
items array false [] The data source.
template func false - The data item template.
onChange func false noop The change handler.

usage

  1. import css
@import "~@feizheng/react-ant-select/dist/style.scss";

// customize your styles:
$react-ant-select-options: ()
  1. import js
import ReactAntSelect from '@feizheng/react-ant-select';
import ReactDOM from 'react-dom';
import React from 'react';
import './assets/style.scss';

class App extends React.Component {
  state = {
    items: [
      {
        value: 'op1',
        label: 'option1d'
      },
      {
        value: 'op2',
        label: 'option2d'
      },
      {
        value: 'op3',
        label: 'option3d'
      }
    ]
  };

  handleChange = (inEvent) => {
    console.log('inEvent.target.value', inEvent.target.value);
  };

  render() {
    const { items } = this.state;
    return (
      <div className="app-container">
        <ReactAntSelect items={items} onChange={this.handleChange} />
      </div>
    );
  }
}

ReactDOM.render(<App />, document.getElementById('app'));

documentation

license

Code released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @feizheng/react-ant-select

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

20.4 kB

Total Files

6

Last publish

Collaborators

  • afeiship