Select下拉菜单模块

Select模块可实现单选和多选,完美替代原生的select-single和select-multiple组件;支持模糊检索和自动完成。

简单使用

select原生标签使用ax-select属性即可表示一个下拉菜单选择器。

  • 输出
  • HTML
  •                 
                    
                

也可以通过id+new的方式创建实例。

  • 输出
  • HTML
  • JS
  •                 
                    
                
  •                 
                    new ax.Select('#demo0001');
                    
                

使用input

不仅可以从select节点开始,也可以从input开始,将选项写入value属性当中,多值以英文逗号“,”隔开。

  • 输出
  • HTML
  •                 
                    
                

列表节点

除了以原生select控件获得列表数据,还可以通过datalistul/ol节点获取列表数据。

  • 输出
  • HTML

基础配置

属性 类型 默认值 说明
name string '' 隐藏input的name属性
value string '' 初始值
field 'label'/'value' 'label' 输出值字段
type 'dropdown'/'check'/'button'/'list' 'dropdown' 列表类型
manual boolean false 是否手动编辑模式
disabled boolean false 是否禁用
readonly boolean false 是否只读
full boolean false 是否横向铺满
multiple boolean false 是否多选
exclude string/number/DOM/object/array '' 初始禁用项
min number 0 最少选择数量
max number 0 最多选择数量
sliced boolean true 是否裁剪超出部分
removable boolean true 是否显示清除按钮
unique boolean true 值是否唯一
span 'tree'/'branch'/'leaf' 'leaf' 选择范围
collapse boolean false 是否折叠所有分支

数据源配置

属性 类型 默认值 说明
content string '' 数据源内容
contType 'text'/'async'/'html'/'auto' 'text' 内容类型
contData object {} 请求数据参数
ajax object {} 异步请求配置

外观配置

属性 类型 默认值 说明
size 'sm'/'md'/'lg' 'md' 选择器尺寸
maxHeight string '' 最大高度
autoWidth boolean true 是否保持下拉菜单宽度
status boolean false 是否使用状态栏

搜索配置

属性 类型 默认值 说明
search.enable boolean false 是否启用搜索
search.value string '' 搜索初始值
search.fuzzy boolean true 是否模糊搜索
search.ignore boolean true 是否忽略大小写
search.result boolean true 是否显示搜索结果

工具模块配置

属性 类型 默认值 说明
tools.enable boolean false 是否启用工具箱
tools.children array ['close'] 工具类型列表
popup.enable boolean true 是否启用弹出层
tags object {} 标签组件参数
tree object {} 树形组件参数

等待函数

属性 类型 默认值 说明
b4Expand function null 展开前等待函数
b4Collapse function null 折叠前等待函数
b4Add function null 添加前等待函数
b4Edit function null 编辑前等待函数
b4Remove function null 删除前等待函数
b4Graft function null 拖拽前等待函数

回调函数

属性 类型 默认值 说明
onRendered function null 渲染完成回调
onTrigger function null 节点触发回调
onAdded function null 添加后回调
onEdited function null 编辑后回调
onRemoved function null 删除后回调
onOutput function null 输出值回调
onDisabled function null 禁用回调
onEnabled function null 启用回调
onDisabledAll function null 全部禁用回调
onEnabledAll function null 全部启用回调
onReadonly function null 只读回调
onReadonlyAll function null 全部只读回调
onPassivated function null 全局禁用回调
onActivated function null 取消全局禁用回调
onExpand function null 展开前回调
onExpanded function null 展开后回调
onCollapse function null 折叠前回调
onCollapsed function null 折叠后回调
onExpandAll function null 全部展开前回调
onExpandedAll function null 全部展开后回调
onCollapsedAll function null 全部折叠前回调
onSelected function null 选中回调
onDeselected function null 取消选中回调
onSelectedAll function null 全选回调
onChecked function null 勾选回调
onUnchecked function null 取消勾选回调
onCheckedAll function null 全部勾选回调
onTooFew function null 选择过少回调
onTooMany function null 选择过多回调
onFilled function null 填充完成回调
onTurned function null 翻页回调
onGetted function null 取值回调
onSetted function null 设置值回调
onCleared function null 清除值回调
onGrafted function null 节点转移回调
onUpdatedCont function null 内容更新回调
onRequest function null 请求完成回调