Vue Data Grid with Spreadsheet Look & Feel
vue-handsontable-official
Handsontable for Vue is the official wrapper for Handsontable, a JavaScript data grid component with a spreadsheet look & feel. It easily integrates with any data source and comes with lots of useful features like data binding, validation, sorting or powerful context menu.
Installation
Use npm to download the project.
npm install handsontable @handsontable/vue
A package scope for Handsontable Pro users:
npm install handsontable-pro @handsontable-pro/vue
Getting Started
Assuming that you have installed the wrapper with npm, now you just need to include Handsontable styles into your build system and use <HotTable>
just like any other Vue component.
Handsontable Community Edition:
Vue Component
<template>
<hot-table :settings="settings"></hot-table>
</template>
<script>
import { HotTable } from '@handsontable/vue';
export default {
data: function() {
return {
settings: {
data: [
["", "Ford", "Volvo", "Toyota", "Honda"],
["2016", 10, 11, 12, 13],
["2017", 20, 11, 14, 13],
["2018", 30, 15, 12, 13]
],
colHeaders: true,
rowHeaders: true,
}
};
},
components: {
HotTable
}
}
</script>
<style src="../node_modules/handsontable/dist/handsontable.full.css"></style>
Handsontable Pro:
Vue Component
<template>
<hot-table :settings="settings"></hot-table>
</template>
<script>
import { HotTable } from '@handsontable-pro/vue';
export default {
data: function() {
return {
settings: {
data: [
["", "Ford", "Volvo", "Toyota", "Honda"],
["2016", 10, 11, 12, 13],
["2017", 20, 11, 14, 13],
["2018", 30, 15, 12, 13]
],
colHeaders: true,
rowHeaders: true,
}
};
},
components: {
HotTable
}
}
</script>
<style src="../node_modules/handsontable-pro/dist/handsontable.full.css"></style>
What to use it for?
The list below gives a rough idea on what you can do with Handsontable, but it shouldn't limit you in any way:
- Database editing
- Configuration controlling
- Data merging
- Team scheduling
- Sales reporting
- Financial analysis
Features
Some of the most popular features include:
- Sorting data
- Data validation
- Conditional formatting
- Freezing rows/columns
- Merging cells
- Defining custom cell types
- Moving rows/columns
- Resizing rows/columns
- Context menu
- Adding comments to cells
- Dragging fill handle to populate data
- Internationalization
- Non-contiguous selection