An open API service indexing awesome lists of open source software.

https://github.com/timwis/vue-lil-context-menu

A flexible context menu component for Vue
https://github.com/timwis/vue-lil-context-menu

context-menu menu vue vuejs

Last synced: 8 months ago
JSON representation

A flexible context menu component for Vue

Awesome Lists containing this project

README

          

# vue-lil-context-menu

A flexible context menu component for Vue. Pass it any menu template you like;
it doesn't even have to be a menu. Always disappears when you expect it
to by using an `onblur` event.

```html


...


  • Option A

  • Option B

const contextMenu = require('vue-lil-context-menu')

module.exports = {
components: {
'context-menu': contextMenu
},
methods: {
onClick (opt) {
console.log('Clicked', opt)
}
}
}

.options {
width: 250px;
border: 1px black solid;
}

```

If you'd like to pass any context from the original `oncontextmenu`
event down to your menu template, you can pass it as the second
param of `open` and access it within a [scoped slot](https://vuejs.org/v2/guide/components.html#Scoped-Slots)
under the `userData` property. For example:

```html


...


  • Option A

  • Option B

  • ```

    ## Related
    - [vue-context-menu](https://github.com/vmaimone/vue-context-menu)