Reputation: 452
I've been struggling on preventing the router link when clicked on the button inside it, e.g:
<router-link to="/a">
<div>...</div>
<button @click.prevent="somemethod()"></button>
</router-link>
When i click on the the child button, i don't want router-link to go on the route
Upvotes: 6
Views: 3196
Reputation: 6048
You should have a button text. I don't see any button text. Add a button text. Then press submit.
<button @click.prevent="somemethod()">SUBMIT</button>
Upvotes: 6