Vuetable-2 - data table simplify!
Vuetable-2 works with Vue 2.x, vuetable is for Vue 1.x
If you're looking for the version that's working with Vue 1.x, please go to vuetable
repo.
Documentation and Tutorial
Documentation is still under development. Meanwhile, check out the Tutorial
with follow-along project here. It should be enough to get you started.
If you've been using Vuetable for Vue 1.x before, checkout what's changed for info on changes from Vuetable for Vue 1.x and the upgrade guide on how you could upgrade from Vuetable for Vue 1.x.
Original version works great but wanted to be able to define action buttons per instance of a data table without depending on a globally defined component. I did this by adding a slot in place of the component that was used in the vuetable.vue.
Use scoped slot in parent when defining the actions Vue Doc for scopped Slots
e.g.
<template slot="actions" scope="props">
<div class="table-button-container">
<button class="btn btn-default" @click="onClick('edit-item', props.rowData)"><i class="fa fa-edit"></i> View</button>
<button class="btn btn-danger" @click="onClick('delete-item', props.rowData)"><i class="fa fa-remove"></i> Edit</button>
</div>
</template>
the onClick function can now be defined in the parent and the parent has Access to rowData and rowIndex via props. :)
The original functionality still works