1.0.9 • Published 5 years ago

react-filter-select v1.0.9

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

A multi select component for React.

Installation

npm i react-filter-select -S

Demo

image

Demo link

http://www.liubaitong.com/reactmulselect/index.html

Usage

import React from 'react'
import ReactDOM from 'react-dom'
import MultiSelect from 'react-filter-select' 

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

    handleChange(checked){
        console.log(checked)  
    }

    render() { 
        return  <MultiSelect
                    options={[{id: "a", name: "a"}]}  
                    onchange={(checked) => this.handleChange(checked)}
                /> 
    }
} 

API

PropTypeDefaultDescription
optionsarrayRequired下拉选项列表 {name: 'xxx', id: 'xxx'}
defaultCheckedarray[]下拉框默认选中项ids 'xxx'
onchangefuncRequired选中的option发生改变时触发的回调函数
selectedWordLengthnumber4选中的项少于多少项时以逗号隔开显示
allowAddboolfalse搜索不到选项时,是否允许添加搜索内容至下拉列表
sizestring"large"下拉框外观大小 @params : "large" or "small"

License

MIT

1.0.9

5 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago