I have couple of questions regarding implementing custom Context Menu on ri开发者_如何学Goght click of a list item .
- 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"
>
精彩评论