DropdownV2 下拉菜单

el-dropdown区别是DropdownV2属于配置化显示且支持多层级且剥离了面板。

基础用法

options来配置选项

使用change事件来处理选中的值,默认 hover

点击触发

设置trigger值为 click 来改变触发方式

使用width属性来控制面板的宽度

触发器

默认插槽为触发器

使用tooltip-options属性来设置第一层级的 tooltip 属性

自定义 label

使用label插槽

面板

使用el-dropdown-v2-panel组件

  • Guide
  • Component
  • Resource

API

属性名说明类型默认值
split-button下拉触发元素呈现为按钮组Booleanfalse
trigger-props触发器按钮所有属性设置Object-
属性名说明类型默认值
options渲染选项Object-
show-timeout弹窗出现前的时间Number200
hide-timeout弹窗关闭时的时间Number200
tooltip-options第一层级的 tooltip 选项Object-
width面板的宽度Number | String140
trigger触发方式enumhover
属性名说明类型默认值
labellabelString-
valuevalueString | Number-
children孩子Array-
disabled是否禁用Boolean-
divided分割线Boolean-
renderLabel自定义渲染 renderFunction-

Slots

事件名说明
default触发器的内容
labellabel 的内容(只有 DropdownV2 才有该插槽,panel 组件使用选项 renderLabel 函数返回 VNode 即可)

源代码

组件样式文档

贡献者