See thenext
branch.
If you're looking for the version that's working with Vue 1.x, please go tovuetable
repo.
Documentation is still under development, but you can view it athttps://ratiw.github.io/vuetable-2.Thanks to @cristijora for the help.
Meanwhile, check out
-
theTutorial with follow-along projecthere.It should be enough to get you started.
-
Sample projectusing Vuetable-2 with Laravel 5.4 and Laravel-Mix
If you've been using Vuetable for Vue 1.x before, checkoutwhat's changedfor info on changes from Vuetable for Vue 1.x and theupgrade guideon how you could upgrade from Vuetable for Vue 1.x.
You can now make use of Vue's scoped slot using the new__slot
special field, thanks to @sjmarve. That means you are able to define action buttons per instance of a data table without depending on a globally defined component.
Use scoped slot in parent when defining the actionsVue Doc for scopped Slots
e.g.
<templateslot= "actions"scope= "props">
<divclass= "table-button-container">
<buttonclass= "btn btn-default"@click= "onClick('edit-item', props.rowData)"><iclass= "fa fa-edit"></i>View</button>
<buttonclass= "btn btn-danger"@click= "onClick('delete-item', props.rowData)"><iclass= "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
- The
icons
prop of VuetablePagination is now moved into thecss
prop object. See thiscodepen.
- Clone the project
- Go into the cloned directory
npm install
npm run dev
- Open browser to
http://localhost:8080
npm install vuetable-2 --save-dev
Thanks to @cristijora for providing helps on this.
// vuetable-2 dependencies
<scriptsrc= "https://cdnjs.cloudflare /ajax/libs/vue/2.2.6/vue.min.js"></script>
<scriptsrc= "https://cdnjs.cloudflare /ajax/libs/axios/0.16.1/axios.min.js"></script>
// vuetable-2
<scriptsrc= "https://unpkg /[email protected]"></script>
Vue.use(Vuetable)
This is demonstrated in thisjsfiddle.
The.use
from above will register all the components globally.
functioninstall(Vue){
Vue.component("vuetable",Vuetable);
Vue.component("vuetable-pagination",VueTablePagination);
Vue.component("vuetable-pagination-dropdown",VueTablePaginationDropDown);
Vue.component("vuetable-pagination-info",VueTablePaginationInfo);
}
Also you have the ability to access certain components if you need them:
VueTable:VueTable.default/VueTable.VueTable,
VueTablePagination:VueTable.VueTablePagination,
VueTablePaginationInfo:VueTable.VueTablePaginationInfo,
VueTablePaginationDropdown:VueTable.VueTablePaginationDropdown
Any contribution to the code (via pull request would be nice) or any part of the documentation and any idea and/or suggestion are very welcome.
Note For any bug fix, the PR should be forked from the
master
branch. And for any suggestion or additional feature, the PR should be forked from thedevelop
branch, where it can be integrated and rolled out in the next release.If you are not sure, please ask by openning a new issue.
However, please do not feel bad if your pull requests or contributions do not get merged or implemented into Vuetable.
Your contributions can, not only help make Vuetable better, but also push it away from what I intend to use it for. I just hope that you find it useful for your use or learn something useful from its source code. But remember, you can always fork it to make it work the way you want.
Vuetable is open-sourced software licensed under theMIT license.