Skip to content

KContextmenu

Avatars can be used to represent people or objects. It supports images, Icons, or characters.

Install

bash
pnpm add @ikun-ui/contextmenu
bash
yarn add @ikun-ui/contextmenu
bash
npm install @ikun-ui/contextmenu

Basic usage

Contextmenu contains three components, they are KContextmenu, KContextItem, KContextSubmenu Write a simple contextmenu

Disable item

Disable an item using the disabled attribute

Divider

Use the divider attribute to turn the item into a dividing line

Use KContextmenuSubMenu to create a sub menu

Contextmenu Props

NameTypeDefaultDescription
disabledbooleanfalseDisable the contextmenu
clsstring''Additional class for component
attrsRecord<string, string>{}Additional attributes

Contextmenu Events

NameDescriptionType
changeTriggered when the KContextmenu component is displayed or closed(value: CustomEvent)=> void
contextmenuTriggered when right clicked.(event: CustomEvent)=> void

Contextmenu Slots

NameDescription
defaultCustomize default content, Please pass in the KContextmenu component or KContextmenuSubMenu component

Contextmenu Item Props

NameTypeDefaultDescription
dividerbooleanfalseShown as dividing line
disabledbooleanfalseDisable the contextmenu item
clsstring''Additional class for component
attrsRecord<string, string>{}Additional attributes

Contextmenu Item Slots

NameDescription
defaultCustomize default content

Contextmenu Sub Menu Props

NameTypeDefaultDescription
titlestring-The title of the submenu
disabledbooleanfalseDisable the contextmenu item
clsstring''Additional class for component
attrsRecord<string, string>{}Additional attributes

Contextmenu Sub Menu Slots

NameDescription
defaultCustomize default content, Please pass in the KContextmenu component

MIT Licensed