I have a basic div that spans 100% of the width, containing a button inside.
The issue I'm facing is that when I add a click event to the div, the entire div becomes clickable (including the button within it).
What I want is for the whole div to be clickable with one method, while the button should trigger a different method when clicked.
<div class="full-width" @click="method1">
<button @click="method2">Click me</button>
</div>
<script>
export default {
methods: {
method1() {
console.log("Div clicked")
},
method2() {
console.log("Button clicked")
}
}
</script>