开发者

Custom Context Menu in v-list vuetify

开发者 https://www.devze.com 2022-12-07 21:09 出处:网络
I have couple of questions regarding implementing custom Context Menu on ri开发者_如何学Goght click of a list item .

I have couple of questions regarding implementing custom Context Menu on ri开发者_如何学Goght click of a list item .

  1. I have this component which has
<v-list>
 <menu-items
        v-for="record in Records"
        :key="record.id"  
      >
   <template v-slot:someslotA>
   <template v-slot:someslotB>
 </menu-items
</v-list>

And inside this menu-items script i have vuetify v-list-item

<v-list-item >
    <!-- icon -->
    <v-list-item-icon>
      <slot name="someslotA">
       ...
      </slot>
    </v-list-item-icon>

  ...
</v-list-item >

Now i want to implement a custom Context Menu whenever any of the list item is right clicked? How do i achieve that ?

2nd Question : Lets say i encapsulate this code more, and add another component upon top of menu-item component. For example

 <my-list
          :records="items"
 >
 </my-list>

And now my-list contains the menu-item component code. eg my-list context

<v-list>
 <menu-items
        v-for="record in Records"
        :key="record.id"  
      >
   <template v-slot:someslotA>
   <template v-slot:someslotB>
 </menu-items
</v-list>

So can i now implement Custom Context Menu on the parent component (my-list) or can it only come with

<menu-items
        v-for="record in Records"
        :key="record.id"  
      >
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号