Skip to content
Title

Dropdown 下拉菜单

将菜单折叠到下拉菜单中。

使用

悬停在下拉菜单上以展开更多


html
<b-dropdown>
  <span> Dropdown List </span>
  <template #dropdown>
    <b-dropdown-menu>
      <b-dropdown-item>Action 1</b-dropdown-item>
      <b-dropdown-item>Action 2</b-dropdown-item>
      <b-dropdown-item>Action 3</b-dropdown-item>
      <b-dropdown-item disabled>Action 4</b-dropdown-item>
      <b-dropdown-item divided>Action 5</b-dropdown-item>
    </b-dropdown-menu>
  </template>
</b-dropdown>
展开代码

触发方式

可以配置点击激活或者悬停激活。

将 trigger 属性设置为 click 即可, 默认为 hover。

click to trigger

hover to trigger
html
<b-dropdown trigger="click">
  <span> Dropdown List </span>
  <template #dropdown>
    <b-dropdown-menu>
      <b-dropdown-item>Action 1</b-dropdown-item>
      <b-dropdown-item>Action 2</b-dropdown-item>
      <b-dropdown-item>Action 3</b-dropdown-item>
      <b-dropdown-item disabled>Action 4</b-dropdown-item>
      <b-dropdown-item divided>Action 5</b-dropdown-item>
    </b-dropdown-menu>
  </template>
</b-dropdown>
展开代码

API

名称说明类型可选值默认值
disabled是否禁用booleanfalse
trigger触发下拉的行为stringhover/click/contextmenuhover
show-timeout展开下拉菜单的延时number250
插槽名说明子标签
下拉菜单的内容Dropdown-Item
名称说明类型可选值默认值
disabled是否禁用booleanfalse
icon自定义图标 触发下拉的行为Componentstring
插槽名说明
自定义 Dropdown-Item 内容

Released under the MIT License.