@feizheng/react-ant-select
v1.1.0
Published
React ant select builder.
Downloads
3
Readme
react-ant-select
React ant select builder.
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
- import css
@import "~@feizheng/react-ant-select/dist/style.scss";
// customize your styles:
$react-ant-select-options: ()
- 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
- https://afeiship.github.io/react-ant-select/
license
Code released under the MIT license.