Skip to content

Commit 702d460

Browse files
col-panicwoothu
authored andcommitted
feat: Pass row-clicked event with cTable component (coreui#138)
1 parent 41b734a commit 702d460

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/views/base/Table.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<b-card>
33
<div slot="header" v-html="caption"></div>
4-
<b-table :dark="dark" :hover="hover" :striped="striped" :bordered="bordered" :small="small" :fixed="fixed" responsive="sm" :items="items" :fields="captions" :current-page="currentPage" :per-page="perPage">
4+
<b-table :dark="dark" :hover="hover" :striped="striped" :bordered="bordered" :small="small" :fixed="fixed" responsive="sm" :items="items" :fields="captions" :current-page="currentPage" :per-page="perPage" @row-clicked="rowClicked">
55
<template slot="status" slot-scope="data">
66
<b-badge :variant="getBadge(data.item.status)">{{data.item.status}}</b-badge>
77
</template>
@@ -82,6 +82,9 @@ export default {
8282
},
8383
getRowCount: function () {
8484
return this.items.length
85+
},
86+
rowClicked (item) {
87+
this.$emit('row-clicked', item)
8588
}
8689
}
8790
}

0 commit comments

Comments
 (0)