This page covers a next version of Handsontable, and is not published yet.
This page covers a non-latest version of Handsontable.
The following example implements the @handsontable/vue component, adding a custom Context Menu.
@handsontable/vue
import Vue from 'vue'; import { HotTable } from '@handsontable/vue'; import { ContextMenu } from 'handsontable/plugins/contextMenu'; import { registerAllModules } from 'handsontable/registry'; import { createSpreadsheetData } from './helpers'; // register Handsontable's modules registerAllModules(); new Vue({ el: '#example1', data() { return { hotSettings: { data: createSpreadsheetData(5, 5), colHeaders: true, contextMenu: { items: { 'row_above': { name: 'Insert row above this one (custom name)' }, 'row_below': {}, 'separator': ContextMenu.SEPARATOR, 'clear_custom': { name: 'Clear all cells (custom)', callback() { this.clear(); } } } }, height: 'auto', licenseKey: 'non-commercial-and-evaluation' } } }, components: { HotTable } });
<div id="example1"> <hot-table :settings="hotSettings"></hot-table> </div>
← Custom ID, Class, Style and other attributes in Vue 2 Custom editor in Vue 2 →