1.1.16 • Published 6 months ago

@albizeka/context-menu-vue3 v1.1.16

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Note

This library is derived by (vue-context) library where main functionality hasn't changed.

vue3-context-menu

VueJS version

context-menu-vue3 provides a simple yet flexible context menu for Vue. It is styled for the standard <ul> tag, but any menu template can be used.

The menu is lightweight with its only dependency being vue3-click-outside. The menu has some basic styles applied to it, but they can be easily overridden by your own styles. The menu disappears when you expect by utilizing vue3-click-outside and it also optionally disappears when clicked on.

Screenshot

Getting Started

The following instructions will help you get the vue-context menu up and running on your project.

Installation

Using npm:

npm i @albizeka/context-menu-vue3

Basic Usage

Import the component and use it in your app.

import VueContext from "@albizeka/context-menu-vue3";
import { ref, nextTick } from "vue";

// Context items
const items = ref(["Item 1", "Item 2"]);

// Action
function onClick(param) {
  console.log("Item clicked");
}

Next add an element to the page that will trigger the context menu to appear, and also add the context menu to the page.

<div id="app">

    <div class="button">
      <p @contextmenu.prevent="$refs.menu.open">Right click on me</p>
    </div>
    
    <VueContext ref="menu">
      <li v-for="item in items">
        <a href="#" @click.prevent="onClick($event.target.innerText)">{{
          item
        }}</a>
      </li>
    </VueContext>
    
</div>

Documentation

Notice: The code in full documentation is written in VUE2 but all functions are the same so everything should work fine

For full documentation, go here: https://randallwilk.dev/docs/vue-context.

If you would like to contribute to the documentation, you can edit the docs found here: https://github.com/rawilk/vue-context/tree/master/docs

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Alternatives

See awesome-vue for other alternatives.

License

@albizeka/context-menu-vue3 uses the MIT License (MIT). Please see the license file for more information.

1.1.16

6 months ago

1.1.15

6 months ago

1.1.14

6 months ago

1.0.14

7 months ago

1.0.13

7 months ago

1.0.12

7 months ago

1.0.11

7 months ago

1.0.10

7 months ago

1.0.9

7 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago

0.0.0

7 months ago