On this page
Row click
Row clicking can be tracked by @rowClick
event
Example
Click any row
ID | Name | Is leader |
---|---|---|
1 | Uno Sacry SaintoFia | |
2 | Nick Niclson | |
0 | Ed Hungry | |
0 | ||
4 | Bars Beautiful | |
5 | Emma | |
6 | Sonja |
7 items
Vue code
vue
<template>
<!-- ... -->
<BetterTable
:structure="tableStructure"
:data="tableData"
@rowClick="rowClick"
/>
<!-- ... -->
</template>
<script>
export default {
/* ... */
methods: {
rowClick(row, index) {
alert(`index: ${index} | name: ${row.name}`);
},
},
/* ... */
};
</script>