Simplified example:
<v-list>
<v-list-item :to="bla/bla">
<v-menu>
<template v-slot:activator="{on}">
<v-btn v-on.prevent="on"/> // I tried .stop, .stop.prevent, self.prevent, prevent.stop
</template>
<div> bla </div>
<v-menu>
</v-list-item>
</v-list>
So as you can see child event v-on triggers v-menu and shows this div. But it also triggers parent :to event. Any ides?
Try to destruct the on
slot prop as follows :
<template v-slot:activator="{ on: { click } }">
<v-btn v-on:click.stop.prevent="click">
open
</v-btn>
</template>
You are using the event modifier on v-on, no on v-on.click.
You can stop the propagation by adding @click
with the modifier separately to the button:
<v-btn v-on="on" @click.stop.prevent />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With