Skip to content

Cascader 级联选择 ​

基于 Element Plus el-cascader 封装,支持静态 options 和远程数据源。

基础用法 ​

基础 / 可搜索 / 禁用

基础 options

值: []

可搜索

值: []

禁用

远程数据 ​

传入 remote 配置自动请求远端接口获取 options,支持字段映射。

静态 / 远程请求

API ​

Props ​

参数说明类型默认值
v-model绑定值string | number | string[]-
options静态选项列表(优先级高于 remote)Record<string, any>[]-
remote远程数据获取配置RemoteConfig-
placeholder占位文本string-
disabled是否禁用booleanfalse
filterable是否可搜索booleanfalse
clearable是否可清空booleantrue

RemoteConfig ​

参数说明类型默认值
url请求地址string-
method请求方法'get' | 'post''get'
paramsURL query 参数Record<string, any>-
body请求体参数(POST)Record<string, any>-
bodyTypebody 格式'json' | 'form-data''json'
labelKey响应中 label 字段名string'label'
valueKey响应中 value 字段名string'value'
childrenKey响应中 children 字段名string'children'

Released under the MIT License.