am-editor11212/plugins/table/README.md

50 lines
870 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# @aomao/plugin-table
表格插件
## 安装
```bash
$ yarn add @aomao/plugin-table
```
添加到引擎
```ts
import Engine, { EngineInterface } from '@aomao/engine';
import Table, { TableComponent } from '@aomao/plugin-table';
new Engine(...,{ plugins:[Table] , cards:[TableComponent]})
```
## 可选项
### 快捷键
默认无快捷键
```ts
//快捷键key 组合键args执行参数[rows?: string, cols?: string] 行数默认3行列数默认3列
hotkey?:string | {key:string,args:Array<string>};//默认无
//使用配置
new Engine(...,{
config:{
"table":{
//修改快捷键
hotkey:{
key:"mod+t",
args:[5,5]
}
}
}
})
```
## 命令
```ts
//可携带两个参数,行数,列数,都是可选的
engine.command.execute('table', 5, 5);
```