@vmo-fed/react-select
v1.0.2
Published
### 安装
Downloads
16
Readme
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>
);
}
}