Skip to content

MenuItem

A single element for the menu. It can be used in Dropdown or in a static component.

Props

title
required
Tytuł elemnetu
type:String
default:''
iconfile
Plik ikonki
type:Object

Slots

default
Space for an additional element on the right

Examples

Elements from Dropdown and icon
html
<dropdown :close="show" @hide-floating="show=false">
  <template #trigger>
    <btn color="primary" text="Button" />
  </template>
  <template #content>
    <div class="pb-1 pt-1.5">
      <menu-item :iconfile="home" title="Menu item 1" to="/" />
      <menu-item @click="change()" :iconfile="home" title="Menu item 2" />
      <menu-item @click="change()" :iconfile="home" title="Menu item 3" />
      <separator size="xs" />
      <menu-item @click="change()" :iconfile="home" title="Menu item 4" />
    </div>
  </template>
</dropdown>
ts
import home from '../../../src/components/icons/IconHome.vue'
import { ref } from 'vue'
const show = ref(false)
function change() {
  show.value = !show.value
}
Elements with dropdown and elements on the right
Menu item 1
99+