Skip to content

DropdownMenu

Dropdownmenu is a container (dropdown alias) for menu elements.

Props

hide
Decides whether to hide the menu
type:Boolean
default:false

Slots

trigger
Slot for the menu start button
content
Menu elements slot

Events

hide-floating
Providing information about closure

Examples

Dropdown menu
html
<dropdown-menu>
  <template #trigger>
    <btn color="primary" text="Button" />
  </template>
  <template #content>
    test
  </template>
</dropdown-menu>
Dropdown menu with closing props
html
<dropdown-menu :hide="show" @hide-floating="show = false">
  <template #trigger>
    <btn color="primary" text="Button" />
  </template>
  <template #content>
    <span @click="close()">close</span>
  </template>
</dropdown-menu>
ts
import { ref } from 'vue'
const show = ref(false)
function close() {
  show.value = true
}