1.0.3 • Published 2 months ago

vue3-menu v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Multi-Level Menu Component

Simple multi-level menu on Vue3

Usage

npm install -save vue3-menu
import { Vue3Menu } from 'vue3-menu';

To apply styles

import 'vue3-menu/src/assets/menu.css';

Or you can add your own menu styles using the .epic-menu class for menu

Menu props

PropDefaultRequiredType
itemstrueMenuItemProps[]Array of menu items
appendTo"body"falsestringThe element where the menu will be added during rendering
anchor0, 1falsenumber, numberTwo values setting the starting position or anchor point of the menu relative to its target
offset0, 0falsenumber, numberAn array of two numbers to offset the menu horizontally and vertically in pixels
behavior"click"false"click" | "hover"Specifies exactly how the menu will open, either by click or on hover
customClassNamefalsestringAdditional class name for customizing menus with custom styles. When rendering the menu uses Teleport, that's why this property was added
contextfalsebooleanDefines the context menu display mode

MenuItemProps

PropDefaultRequiredType
iconfalseComponentInternalInstanceAdds an icon before the menu item label.
labelfalsestring | numberMenu item label
itemsfalseMenuItemProps[]An array of settings for creating submenus.
stylefalseStyleValueDefining styles for menu item formatting
shortcutfalsestringHotkey indicator. The indicator is inserted after the menu item label
componentfalseComponentInternalInstanceInstead of a standard menu item, you can add any component
separatorfalsebooleanInstead of a menu item there will be a separator
commandfalsefunctionHandler called when a menu item is clicked
stopPropagationfalsebooleanstopPropagation

Examples

Simple menu

const items = [{
        label: 'Upload from computer',
    }, {
        label: 'Search the web',
    }, {
        separator: true,
    }, {
        label: 'Drive',
    }, {
        label: 'Photos',
    }, {
        label: 'By URL',
    }, {
        label: 'Camera',
    }];
<template>
  <div>
    <Menu :items="items"/>
  </div>
</template>

License

MIT

1.0.3

2 months ago

1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago