Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
selectable + transitions bootstrap-vue table
<template>
<div>
<b-table
id="table-transition-example"
:items="items"
:fields="fields"
striped
small
primary-key="a"
selectable
:select-mode="selectMode"
selected-variant="active"
@row-selected="onRowSelected"
:tbody-transition-props="transProps"
></b-table>
{{ selected }}
</div>
</template>
<script>
export default {
data() {
return {
transProps: {
// Transition name
name: 'flip-list'
},
items: [
{ a: 2, b: 'Two', c: 'Moose' },
{ a: 1, b: 'Three', c: 'Dog' },
{ a: 3, b: 'Four', c: 'Cat' },
{ a: 4, b: 'One', c: 'Mouse' }
],
fields: [
{ key: 'a', sortable: true },
{ key: 'b', sortable: true },
{ key: 'c', sortable: true }
],
selectMode: 'multi',
selected: []
}
},
methods: {
onRowSelected(items) {
this.selected = items
},
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.