This page covers a non-latest version of Handsontable.
# Custom context menu example in Vue 3
Table of contents
# Overview
The following example implements the @handsontable/vue3
component, adding a custom Context Menu.
Find out which Vue 3 versions are supported
# Example
import { createApp } from 'vue';
import { HotTable } from '@handsontable/vue3';
import { ContextMenu } from 'handsontable/plugins/contextMenu';
import { registerAllModules } from 'handsontable/registry';
import { createSpreadsheetData } from './helpers';
// register Handsontable's modules
registerAllModules();
const app = createApp({
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,
}
});
app.mount('#example1');
# Related articles
# Related guides
# Related blog articles
# Related API reference
- Configuration options:
- Hooks:
- Plugins: