MigsLab UIVue 3 component workshop

Components

Button Dropdown

A button that opens a menu of actions, optionally split into a main action and a menu toggle.

import { ButtonDropdownComponent, ButtonDropdownItemComponent } from '@/MigsLab/shared'

Dropdown

<ButtonDropdownComponent color="secondary" bordered rounded menu-align="left">
  <template #button>Actions</template>
  <template #menu>
    <ButtonDropdownItemComponent @select="Edit_Select">Edit</ButtonDropdownItemComponent>
    <ButtonDropdownItemComponent disabled>Archive</ButtonDropdownItemComponent>
  </template>
</ButtonDropdownComponent>

Split button

The left part emits action; the chevron opens the menu.

<ButtonDropdownComponent rounded split-button @action="Run_Click">
  <template #button>Run process</template>
  <template #menu>
    <ButtonDropdownItemComponent @select="Schedule_Select">Schedule</ButtonDropdownItemComponent>
  </template>
</ButtonDropdownComponent>

Last action: none

API

ButtonDropdownComponent props

NameType Default Description
color'primary' | 'secondary' | 'danger' | 'ghost''primary'Color variant of the button(s).
size'sm' | 'md' | 'lg''md'Button size.
outlined / bordered / roundedbooleanfalseSame as ButtonComponent.
disabledbooleanfalseDisables the buttons and the menu.
splitButtonbooleanfalseSeparate main action button and chevron toggle.
closeOnSelectbooleantrueClose the menu after an item is selected.
menuAlign'left' | 'right''right'Which edge the menu lines up with.

Events

EventPayloadDescription
actionMouseEventSplit mode only: the main button was clicked.
select (item)MouseEventEmitted by ButtonDropdownItemComponent when chosen.

Slots

NameDescription
buttonButton label.
menuMenu content, usually ButtonDropdownItemComponent items.

ButtonDropdownItemComponent props

NameType Default Description
disabledbooleanfalseGreys out the item and ignores clicks.