A multi select component for React.
Installation
npm i react-filter-
Demo
Demo link
http://www.liubaitong.com/reactmulselect/index.html
Usage
Component { superprops; } { console } { return <MultiSelect options=id: "a" name: "a" onchange= this /> }
API
Prop | Type | Default | Description |
---|---|---|---|
options | array | Required | 下拉选项列表 [{name: 'xxx', id: 'xxx'}] |
defaultChecked | array | [] | 下拉框默认选中项ids ['xxx'] |
onchange | func | Required | 选中的option发生改变时触发的回调函数 |
selectedWordLength | number | 4 | 选中的项少于多少项时以逗号隔开显示 |
allowAdd | bool | false | 搜索不到选项时,是否允许添加搜索内容至下拉列表 |
size | string | "large" | 下拉框外观大小 @params : "large" or "small" |
License
MIT