Skip to content

Commit

Permalink
Add row click listener and emitter (spatie#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterjandesmedt authored and sebastiandedeyne committed Nov 15, 2017
1 parent 7566731 commit a5a258a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/components/TableComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
:key="row.vueTableComponentInternalRowId"
:row="row"
:columns="columns"
@rowClick="emitRowClick"
></table-row>
</tbody>
<tfoot>
Expand Down Expand Up @@ -312,6 +313,10 @@
this.saveState();
},
emitRowClick(row) {
this.$emit('rowClick', row);
}
},
};
</script>
2 changes: 1 addition & 1 deletion src/components/TableRow.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<tr>
<tr @click="$emit('rowClick', row)">
<table-cell
v-for="column in visibleColumns"
:row="row"
Expand Down

0 comments on commit a5a258a

Please sign in to comment.