GithubHelp home page GithubHelp logo

Comments (5)

johndatserakis avatar johndatserakis commented on May 31, 2024 1

Hey there - good idea! I'll get this up and pushed by tonight.

from vue-simple-context-menu.

RicardoRamirezR avatar RicardoRamirezR commented on May 31, 2024

Maybe:

<ul :id="id" class="vue-simple-context-menu" v-click-outside="onClickOutside">
    <li v-for="option in options" @click="optionClicked(option)" class="vue-simple-context-menu__item">
        {{option.name}}
    </li>
</ul>
data () {
    return {
        ...
        id: null
    }
}, 
mounted () {
    this.id = "vue-simple-context-menu-id-" + this._uid;
}

of course, changing all references to this.id

from vue-simple-context-menu.

johndatserakis avatar johndatserakis commented on May 31, 2024

Ok dude - the update is up. I bumped the major version because now the prop of id is a required unique String. So we're at version 2.0.0.

I updated the styling a bit as well. The README has been updated to show users how to use multiple menus. The main example now has 2 menus - so check that out to see the implementation.

Let me know how it goes for you.

from vue-simple-context-menu.

RicardoRamirezR avatar RicardoRamirezR commented on May 31, 2024

Great! Just a thing. Why is required the id when you can generate one like in the mounted function above, the this._uidgives a different number for each component.

from vue-simple-context-menu.

johndatserakis avatar johndatserakis commented on May 31, 2024

Good question! The main reason I have the developer set the id is so that they can control and organize the element to their liking. This puts it in their hands when developing. I've done this is in the past with another library and it seems to work well.

from vue-simple-context-menu.

Related Issues (20)

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.