@vmo-fed/react-select

1.0.2 • Public • Published

react-select

安装

npm i @vmo-fed/react-select -S

使用

import Select from '@vmo-fed/react-select';

class HelloMessage extends React.Component {
  constructor(props) {
    super(props);

    this.onSelect = this.onSelect.bind(this);
  }

  onSelect({name, value}) {
    console.log('Selected name: ' + name);
    console.log('Selected name: ' + value);
  }

  render() {
    const data = [
      {name: '1', value: 'value 1'},
      {name: '2', value: 'value 2'},
      {name: '3', value: 'value 3'},
    ];
    return (
      <div>
        <Select onSelect={this.onSelect} data={data} initValue="请选择..." />
      </div>
    );
  }
}

在线DEMO

在线文档

Readme

Keywords

none

Package Sidebar

Install

npm i @vmo-fed/react-select

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

774 kB

Total Files

17

Last publish

Collaborators

  • jliu1992
  • supershy
  • wangluwang