Custom Context Menu example

优质
小牛编辑
119浏览
2023-12-01

An implementation of the @handsontable/vue component with a custom Context Menu added.

import Vue from 'vue'; import { HotTable } from '@handsontable/vue'; import Handsontable from 'handsontable'; new Vue({ el: '#example1', data: function() { return { hotSettings: { data: Handsontable.helper.createSpreadsheetData(5, 5), colHeaders: true, contextMenu: { items: { 'row_above': { name: 'Insert row above this one (custom name)' }, 'row_below': {}, 'separator': Handsontable.plugins.ContextMenu.SEPARATOR, 'clear_custom': { name: 'Clear all cells (custom)', callback: function() { this.clear(); } } } } } } }, components: { HotTable } });

Edit this page