I need to make a table row clickable in order to trigger a function in the parent component. While I have a working example below, it's not clean due to a specific cell that must not be clickable. Typically, I would use a <router-link>
tag to wrap the row, but this exception complicates things.
<td
@click.prevent="(!day.submitted || day.rejected ) ? $emit('update', day) : ''"
onMouseOver="this.style.cursor='pointer'"
class="py-0 w-1/4">
Is there a way to shorten this code? I've attempted to create a custom directive without success.
<td clickMe>{{ day.hours }}</td>
An approach like the above example would be preferable - any suggestions on how I can accomplish this?