Vue 2 Data GridBasic example in Vue 2

Start with a basic example of the Vue 2 data grid, using component props for configuration and external control.

On this page

Example

In this example, a div element of id="example1" where the @handsontable/vue component will be rendered.

import { HotTable } from '@handsontable/vue';
import { registerAllModules } from 'handsontable/registry';
import 'handsontable/dist/handsontable.full.css';

// register Handsontable's modules
registerAllModules();

const ExampleComponent = {
  data() {
    return {
      hotSettings: {
        data: [
          ['', 'Ford', 'Volvo', 'Toyota', 'Honda'],
          ['2016', 10, 11, 12, 13],
          ['2017', 20, 11, 14, 13],
          ['2018', 30, 15, 12, 13]
        ],
        colHeaders: true,
        height: 'auto',
        autoWrapRow: true,
        autoWrapCol: true,
        licenseKey: 'non-commercial-and-evaluation'
      }
    };
  },
  components: {
    HotTable
  }
};

export default ExampleComponent;

There is a newer version of Handsontable available. Switch to the latest version ⟶