This page covers a next version of Handsontable, and is not published yet.

This page covers a non-latest version of Handsontable.

# Basic example in Vue 2

Table of contents

# Overview

The following example is a simple implementation of the @handsontable/vue component.

# Example

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

import Vue from 'vue';
import { HotTable } from '@handsontable/vue';
import { registerAllModules } from 'handsontable/registry';
import { createSpreadsheetData } from './helpers';

// register Handsontable's modules
registerAllModules();

new Vue({
  el: '#example1',
  data: function() {
    return {
      hotSettings: {
        data: createSpreadsheetData(6, 10),
        colHeaders: true,
        height: 'auto',
        licenseKey: 'non-commercial-and-evaluation'
      }
    }
  },
  components: {
    HotTable
  }
});