Context menu

BsContextMenu replaces the browser's context menu on the element its props are bound to. A right-click opens the content slot at the pointer; Shift+F10 and the ContextMenu key open it at the element. Escape, a click elsewhere, scrolling or choosing an item closes it, and focus returns.

Basic usage

Right-click here

Chosen: nothing yet

Source

<BsContextMenu>  <template #default="{ props }">    <div tabindex="0" v-bind="props">Right-click here</div>  </template>  <template #content>    <BsDropdownMenu @item-select="({ value }) => (chosen = value)">      <BsDropdownItem value="cut">Cut</BsDropdownItem>      <BsDropdownItem value="copy">Copy</BsDropdownItem>      <BsDropdownItem value="paste">Paste</BsDropdownItem>    </BsDropdownMenu>  </template></BsContextMenu>