1.0.11 • Published 4 years ago

multiple-cascader v1.0.11

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Multiple Cascader

基于antd的cascader级联菜单实现的多选级联功能

Purpose


由于项目中有基于多个级联选项来进行查询搜索的需求,基于此扩展了ant的级联菜单只能单选的功能; 目前multiple-cascader只能选中多个三级菜单,选中一、二级时为单选功能,若选到三级时,则无法选中一二级,但可选多个三级;

Useage


  • npm install multiple-cascader
<MultipleCascader {...props} />

Options


  • 与antd的cascader参数大部分相同, 以下详细列出当前支持与不支持(后期会迭代版本予以支持)的参数:
参数说明类型默认值是否支持
selectMax最大输入条数number-新增
allowClear是否支持清除booleantrueY
autoFocus自动获取焦点booleanfalseN
changeOnSelect当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示booleanfalseY
selectChange选中完成后的回调(isCeil, notAllow) => void-新增
className自定义类名string-Y
defaultValue默认的选中项string[][]N
disabled禁用booleanfalseY
displayRender选择后展示的渲染函数(label, selectedOptions) => ReactNodelabel => label.join(' / ')N
expandTrigger次级菜单的展开方式,可选 'click' 和 'hover'string'click'Y
fieldNames自定义 options 中 label name children 的字段object{ label: 'label', value: 'value', children: 'children' }N
getPopupContainer菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。示例Function(triggerNode)() => document.bodyY
loadData用于动态加载选项,无法与 showSearch 一起使用(selectedOptions) => void-N
notFoundContent当下拉列表为空时显示的内容string'Not Found'Y
options可选项数据源Option[]-Y
placeholder输入框占位文本string'请选择'Y
popupClassName自定义浮层类名string-Y
popupPlacement浮层预设位置:bottomLeft bottomRight topLeft topRightEnumbottomLeftY
popupVisible控制浮层显隐boolean-Y
showSearch在选择框中显示搜索框booleantrueN
size输入框大小,可选 large default smallstringdefaultN
style自定义样式string-N
suffixIcon自定义的选择框后缀图标ReactNode-N
value指定选中项string[]-N
onChange选择完成后的回调(value, selectedOptions) => void-Y
onPopupVisibleChange显示/隐藏浮层的回调(value) => void-N
1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago