Modules in Vue 3
Reduce the size of your Vue 3 app by importing only the modules that you need and use.
Find out which Vue 3 versions are supported
Use modules with Vue 3
To use modules with Handsontable’s Vue 3 wrapper, follow the steps below:
Import the base module
No matter which optional modules you use, you need to import the base module.
In the entry point file of your application, import the
handsontable/basemodule:import Handsontable from 'handsontable/base';Import optional modules
Import optional modules of your choice, along with their registering functions.
For example, to import the
numericcell type module and theUndoRedoplugin module:import {registerCellType, // cell types' registering functionNumericCellType,} from 'handsontable/cellTypes';import {registerPlugin, // plugins' registering functionUndoRedo,} from 'handsontable/plugins';Register your modules
Register your modules, to let Handsontable recognize them.
For example, to register the
numericcell type module and theUndoRedoplugin module:registerCellType(NumericCellType);registerPlugin(UndoRedo);
Full example
import { createApp } from 'vue';import App from './App.vue';import router from './router';
import Handsontable from 'handsontable/base';
import { registerCellType, NumericCellType,} from 'handsontable/cellTypes';
import { registerPlugin, UndoRedo,} from 'handsontable/plugins';
registerCellType(NumericCellType);registerPlugin(UndoRedo);
createApp(App).use(router).mount('#app');