v-contextmenu icon indicating copy to clipboard operation
v-contextmenu copied to clipboard

How to access the element under the contextmenu?

Open crystalfp opened this issue 2 years ago • 0 comments

I have the contextmenu over a list of <div> (see below). How could I access the div over which I right clicked to open the contextmenu? Here is an example:

  <v-contextmenu ref="contextmenu">
    <v-contextmenu-item @click.prevent="showContent">Menu Item</v-contextmenu-item>
  </v-contextmenu>

  <div v-contextmenu:contextmenu>
    <div id="aaa">Item aaa</div>
    <div id="bbb">Item bbb</div>
    <div id="ccc">Item ccc</div>
  </div>

in the method showContent how I could access the id of the div I right-clicked on? Thanks for your help! mario

crystalfp avatar Dec 25 '21 19:12 crystalfp