Basic Usage

Using the menu requires very little setup as shown below.

To use the context menu, you need to import it into your component and then create a trigger element to open the context menu on.

        <p @contextmenu.prevent="$">
            Right click on me

        <vue-context ref="menu">
                <a @click.prevent="onClick($">
                    Option 1
                <a @click.prevent="onClick($">
                    Option 2

    import VueContext from 'vue-context';
    import 'vue-context/src/sass/vue-context.scss'; // Alternatively import into a stylesheet instead

    export default {
        components: { VueContext },

        methods: {
            onClick (text) {
                alert(`You clicked "${text}"!`);
← Previous Topic


Next Topic →

Advanced Usage