Cascader 级联选择器
规则
基础示例
Props 配置示例
可搜索
任意一级可选(changeOnSelect)
整段禁用
尺寸对比(小 / 中 / 大)
Events 事件示例
value:string[] | number[]
Props
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|---|---|---|---|---|
| allowClear | 支持清除 | boolean | | true | - |
| changeOnSelect | 单选时生效(multiple 下始终可选),点选每级菜单选项值都会发生变化 | boolean | false | - |
| classes | 用于自定义组件内部各语义化结构的 class | Record<SemanticDOM, string> | (info: { props }) => Record<SemanticDOM, string> | - | - |
| disabled | 禁用 | boolean | false | - |
| expandTrigger | 次级菜单展开方式 | click | hover | click | - |
| fieldNames | 自定义 options 中 label / value / children | object | { label, value, children } | - |
| getPopupContainer | 菜单渲染父节点 | (triggerNode) => HTMLElement | () => document.body | - |
| loadData | 动态加载选项,无法与 showSearch 一起使用 | (selectedOptions) => void | - | - |
| maxTagCount | 最多显示多少个 tag | number | responsive | - | - |
| maxTagPlaceholder | 隐藏 tag 时显示的内容 | VueNode | function(omittedValues) | - | - |
| maxTagTextLength | 最大显示的 tag 文本长度 | number | - | - |
| multiple | 支持多选节点 | boolean | - | - |
| open | 控制浮层显隐 | boolean | - | - |
| options | 可选项数据源 | Option[] | - | - |
| placeholder | 输入框占位文本 | string | - | - |
| placement | 浮层预设位置 | bottomLeft | bottomRight | topLeft | topRight | bottomLeft | - |
| popupMenuColumnStyle | 下拉菜单列的样式 | CSSProperties | - | - |
| showCheckedStrategy | 选中项回填方式(multiple 为 true 时) | Cascader.SHOW_PARENT | Cascader.SHOW_CHILD | Cascader.SHOW_PARENT | - |
| showSearch | 在选择框中显示搜索框 | boolean | Object | false | - |
| size | 输入框大小 | large | middle | small | - | - |
| status | 设置校验状态 | error | warning | - | - |
| styles | 用于自定义内部语义化结构的 style | Record<SemanticDOM, CSSProperties> | (info: { props }) => Record<SemanticDOM, CSSProperties> | - | - |
| value | 指定选中项,支持 v-model:value | string[] | number[] | - | - |
| variant | 形态变体 | outlined | borderless | filled | underlined | outlined | - |
Events
| 事件 | 说明 | 类型 | 版本 |
|---|---|---|---|
| change | 选择完成后的回调 | (value, selectedOptions) => void | - |
| openChange | 显示/隐藏浮层的回调 | (open: boolean) => void | - |


