So, I got a table with <tr>
s which are clickable. And inside a <td>
a link:
<tr
@click="editPlatform(platform.id)"
v-for="platform in platforms"
:key="'platform_table_' + platform.id"
>
<td>{{ platform.id }}</td>
<td>Many more tds</td>
<td>
<router-link
:to="{ name: 'platformUsers', params: {id: platform.id} }">
{{ platform.users.length }}
</router-link>
</td>
</tr>
methods: {
editPlatform(id) {
this.$router.push({ name: 'editPlatform', params: { id: id } });
},
}
And the <router-link>
event seems to bubble through. The url changes to the platformUsers
for a millisecond but then the editPlatform(id)
is also triggered and it goes there.
I tried <router-link @click.native.prevent="editPlatform(platform.id)" ...>
and style="pointer-events: none;"
on the router-link - but they don't work either.
Any idea beside setting the "@click" on each td - beside the one with the link?