Giter VIP home page Giter VIP logo

vue-context-menu's Introduction

add-context-menu

A simple universal context menu for HTML elements.
https://www.npmjs.com/package/add-context-menu
https://github.com/Rudeus3Greyrat/vue-context-menu

Installation

# install with npm
npm i add-context-menu

Quick Start

# import add-context-menu
import ContextMenu from 'add-context-menu'
import ContextMenuItem from 'add-context-menu'
Vue.use(ContextMenu)
Vue.use(ContextMenuItem)

How to Use

# Put context-menu including context-menu-items closely next to the element that you want add customed context menu to.

Example

<div id='example'></div>
<context-menu @select="handleSelect" :divided="true">
    <context-menu-item :select="download">Download</context-menu-item>
    <context-menu-item :select="rename" :disabled="true">Rename</context-menu-item>
    <context-menu-item :select="moreInfo">More Info</context-menu-item>
</context-menu>

# In this case, HTML element 'example' is the one we want to add customed context menu to.
# <context-menu></context-menu> is the wrapper of the menu.
# <context-menu-item></context-menu-item> is the item in context menu.

context-menu Attributes

Attribute Description Type Default
divided whether a divider is displayed for whole context menu Boolean false

context-menu Events

Event Name Description Parameters
select triggers when a context menu item is clicked the select dispatched from the context menu item

context-menu-item Attributes

Attribute Description Type Default
select a select to be dispatched to context-menu's select callback String/Number/Object ''
disabled whether the item is disabled Boolean false

context-menu-item Slot

Custom content for context-menu-item.

For detailed explanation on how things work, consult the docs for vue-loader.

vue-context-menu's People

Contributors

rudeus3greyrat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.