Skip to content

EPSelect 下拉选择组件

基础用法

格式化 label

空值格式化(^0.2.5)

多选

全选(需配合 multiple 使用)

虚拟列表

EPSelect 属性


1、代码示例

html
<e-p-select v-model="selectValue" :options="options" />

2、配置参数

参数说明类型默认值
v-model绑定值 boolean / string / number/Array-
multiple是否多选Booleanfalse
options下拉数据源Array[]
useVirtual是否开启虚拟列表(继承 el-select-v2 属性)Booleanfalse

3、事件

名称说明类型
change当选中的值改变时触发Function(value: any) => void
visible-change当下拉框出现/消失时触发Function(visible: boolean) => void
remove-tag当在多选模式中删除标签时触发Function(tagValue: any) => void
clear当点击可清除选择框中的清除图标时触发Function() => void
blur当输入框失去焦点时触发Function(event: FocusEvent) => void
focus当输入框获得焦点时触发Function(event: FocusEvent) => void

4、属性继承

名称说明类型默认值
v-model绑定值string / number / boolean / object / array
multiple是否启用多选booleanfalse
disabled是否禁用选择框booleanfalse
value-key值的唯一标识键名,当值为对象时必填stringvalue
size输入框大小enum -
clearable是否可以清除选择booleanfalse
collapse-tags是否在多选时将标签折叠为文本booleanfalse
collapse-tags-tooltip ^(2.3.0)鼠标悬停折叠标签时是否显示所有选中的标签。使用此功能时,collapse-tags 必须为真booleanfalse
multiple-limitmultipletrue 时,用户可选择的最大选项数。设置为 0 时不限制number0
name选择输入框的名称属性string
effect工具提示主题,内置主题:dark / lightlight
autocomplete选择输入框的自动完成属性
placeholder占位符,默认为 'Select'string
filterable是否可过滤booleanfalse
allow-create是否允许创建新选项。使用此功能时,filterable 必须为真booleanfalse
filter-method自定义过滤方法Function() => void
remote是否从服务器加载选项booleanfalse
remote-method自定义远程搜索方法Function() => void
remote-show-suffix在远程搜索方法中显示后缀图标booleanfalse
loading是否正在从服务器加载数据booleanfalse
loading-text加载数据时显示的文本,默认为 'Loading'string
no-match-text当没有数据与过滤查询匹配时显示的文本,也可以使用插槽 empty,默认为 'No matching data'string
no-data-text当没有选项时显示的文本,也可以使用插槽 empty,默认为 'No data'string
popper-class选择下拉框的自定义类名string''
reserve-keywordmultiplefilterable 为 true 时,是否在选择选项后保留当前关键字booleantrue
default-first-option按下回车键时选择第一个匹配的选项。需与 filterableremote 一起使用booleanfalse
teleported选择下拉框是否传送到 bodybooleantrue
append-to ^(2.8.4)选择下拉框附加到哪个元素string
persistent当选择下拉框不活动且 persistentfalse 时,选择下拉框将被销毁booleantrue
automatic-dropdown对于非过滤选择框,此属性决定输入框聚焦时选项菜单是否弹出booleanfalse
clear-icon自定义清除图标组件string / objectComponentCircleClose
fit-input-width下拉框的宽度是否与输入框相同booleanfalse
suffix-icon自定义后缀图标组件string / objectComponentArrowDown
placement ^(2.2.17)下拉框位置enum'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end' | bottom-start
max-collapse-tags ^(2.3.0)需要显示的 Tag 的最大数量 只有当 collapse-tags 设置为 true 时才会生效。number1
popper-optionspopper.js 的参数object 参考 popper.js 文档{}
tag-type标签类型enuminfo
tag-effect ^(2.7.7)标签效果enum'' | 'light' | 'dark' | 'plain' | light
validate-event是否触发表单验证booleantrue