Form plugin
$ yarn add @aomao/plugin-table
Add to engine
import Engine, {EngineInterface} from'@aomao/engine';import Table, {TableComponent} from'@aomao/plugin-table';new Engine(...,{ plugins:[Table], cards:[TableComponent]})
No shortcut keys by default
//Shortcut keys, key combination keys, args, execution parameters, [rows?: string, cols?: string] Number of rows: default 3 rows, number of columns: default 3 columnshotkey?:string | {key:string,args:Array<string>};//default none//Use configurationnew Engine(...,{config:{"table":{//Modify shortcut keyshotkey:{key:"mod+t",args:[5,5]}}}})
enableScrollbar
needs to be turned on to take effectoverflow?: {// Relative to the maximum displayable width on the left side of the editormaxLeftWidth?: () => number;// Relative to the maximum displayable width on the right side of the editormaxRightWidth?: () => number;};
colMinWidth: number; //default 40
rowMinHeight: number; //default 30
maxInsertNum: number; //default 50
enableScrollbar: boolean; //default true
//Can carry two parameters, the number of rows and the number of columns, all are optionalengine.command.execute('table', 5, 5);