[Vuejs]-How to open a dialog when clicking a card but prevent opening the dialog when clicking child elements?

1👍

Place @click.stop on the elements on which you don’t want the click to bubble.

Working demo.

Documentation: event modifiers.


Note: if you place @click.stop on the card’s immediate children (which is what you asked for), you won’t be able to open the dialogue anymore as the entire surface of the card is covered by: <v-card-title />, <v-card-text /> and <v-card-actions />, effectively leaving no pixel where a click would actually open the dialogue.

👤tao

Leave a comment