Is there a way to pass the item index as a parameter to the function within the v-list-item-action
element? Thank you in advance!
<v-list-item
v-for="(layer, i) in layers"
:key="i">
<template v-slot="{ item, index }">
<v-list-item-action>
<v-btn
@click="changeVisible(index)"
icon>
<v-icon
color="blue darken-2"
v-if="layer.show">
mdi-eye
</v-icon>
<v-icon
v-else>
mdi-eye-off
</v-icon>
</v-btn>
</v-list-item-action>
<v-list-item-title v-text="layer.name"></v-list-item-title>
<v-list-item-action>
<v-btn
@click="changeEdit"
icon>
<v-icon
color="blue darken-2"
v-if="layer.edit">
mdi-pencil
</v-icon>
<v-icon
v-else>
mdi-pencil
</v-icon>
</v-btn>
</v-list-item-action>
</template>
</v-list-item>