0.5.10 • Published 5 years ago

uxcore-select2 v0.5.10

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

uxcore-select2 Dependency Status devDependency Status

TL;DR

uxcore-select2 ui component for react

setup develop environment

$ git clone https://github.com/uxcore/uxcore-select2
$ cd uxcore-select2
$ npm install
$ npm start

Usage

var Select = require('uxcore-select2');
<Select>
  <Option value="lucy">lucy</Option>
</Select>

demo

http://uxcore.github.io/select/

Props

Select props

参数说明类型默认值
value指定当前选中的条目string/Array
defaultValue指定默认选中的条目string/Array
multiple支持多选boolfalse
filterOption是否根据输入结果过滤选项,默认是使用 optionFilterProp 对应的 Option 属性来过滤bool/function(inputValue, Option)true
showSearch是否在单选模式下显示搜索booltrue
tags可以把随意输入的条目作为tag,输入项不需要与下拉选项匹配boolfalse
onSelect被选中时调用,参数为选中的option value值function(value, option:Option)
onDeselect取消选中时调用,参数为选中的option value值,仅在multiple或tags模式下生效function(value)
onChange选中option,或input的value变化(combobox模式下)时,调用此函数function
onSearch搜索框值发生变化时调用function(key)noop
allowClear显示清除按钮false
placeholder选择框默认文字string
searchPlaceholder搜索框默认文字string
optionFilterProp输入项过滤对应的 option 属性stringvalue
combobox输入框自动提示模式boolfalse
optionLabelProp选择 Option 的哪个 prop 作为选择框中的显示。string'children'
getPopupContainer弹出的菜单渲染在哪个容器中function(trigger:Node):Nodefunction(){return document.body;}
dropdownMatchSelectWidthdropdown 部分是否和 select 部分同宽booleantrue
dropdownClassNamedropdown 部分的定制类名string-
notFoundContent未找到选项时的提示文案stringnot found
size尺寸,枚举值 large, small, middlestringlarge

Option props

参数说明类型默认值
disabled是否禁用Booleanfalse
key如果react需要你设置此项,此项值与value的值相同,然后可以省略value设置String
value默认根据此属性值进行筛选String-
title如果你不满意自动生成的 title,你可以用这个 prop 来修改String-

OptGroup props

参数说明类型默认值
label组名String/React.Element
keyString-
0.5.10

5 years ago

0.5.9

5 years ago

0.5.8

5 years ago

0.5.8-beta2

5 years ago

0.5.8-beta.1

5 years ago

0.5.7

6 years ago

0.5.6

6 years ago

0.4.26

6 years ago

0.5.5

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.25

7 years ago

0.4.24

7 years ago

0.4.23

7 years ago

0.4.22

7 years ago

0.4.21

7 years ago

0.4.20

7 years ago

0.4.19

7 years ago

0.4.18

7 years ago

0.4.17

7 years ago

0.4.16

7 years ago

0.4.15

7 years ago

0.4.14

7 years ago

0.4.13

7 years ago

0.4.12

8 years ago

0.4.11

8 years ago

0.4.10

8 years ago

0.4.9

8 years ago

0.4.8

8 years ago

0.4.7

8 years ago

0.4.6

8 years ago

0.4.5

8 years ago

0.4.4

8 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.5

8 years ago

0.3.4

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.8

8 years ago

0.2.7

9 years ago

0.2.6

9 years ago

0.2.5

9 years ago

0.2.4

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.16

9 years ago

0.1.15

9 years ago

0.1.14

9 years ago

0.1.13

9 years ago

0.1.12

9 years ago

0.1.11

9 years ago

0.1.10

9 years ago

0.1.9

9 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago