docs: 完善文档

This commit is contained in:
roymondchen 2022-05-07 16:51:52 +08:00 committed by jia000
parent 88cc033e0d
commit 10349fb453
3 changed files with 39 additions and 6 deletions

View File

@ -270,6 +270,17 @@ import { ArrowLeft, Coin } from '@element-plus/icons';
- **详情:** - **详情:**
画布中的选中框配置选项,使用的是[moveable](https://github.com/daybrush/moveable)第三方库 画布中的选中框配置选项,使用的是[moveable](https://github.com/daybrush/moveable)第三方库
### stageRect
- **类型:** { width: number; height: number }
- **默认值:** { width: 375, height: 817 }
- **详情:**
画布的大小配置
## slots ## slots
### nav ### nav

View File

@ -337,11 +337,11 @@ const node = editorService.get('node');
editorService.alignCenter(node); editorService.alignCenter(node);
``` ```
- ### swap - ### moveLayer
- **参数:** - **参数:**
- `{number | 'latest' | 'first'` offset - `{number | 'top' | 'bottom'` offset
- **用法:** - **用法:**
@ -352,10 +352,10 @@ editorService.alignCenter(node);
```js ```js
import { editorService } from '@tmagic/editor'; import { editorService } from '@tmagic/editor';
editorService.swap('bottom'); // 置底 editorService.moveLayer('top'); // 置底
editorService.swap('first'); // 置顶 editorService.moveLayer('bottom'); // 置顶
editorService.swap(1); // 上移一层 editorService.moveLayer(1); // 上移一层
editorService.swap(-1); // 下移一层 editorService.moveLayer(-1); // 下移一层
``` ```
- ### undo - ### undo
@ -394,6 +394,26 @@ import { editorService } from '@tmagic/editor';
editorService.redo(); editorService.redo();
``` ```
- ### move
- **参数:**
- `{number}` left
- `{number}` top
- **用法:**
绝对定位布局下,移动组件位置
- **示例:**
```js
import { editorService } from '@tmagic/editor';
editorService.move(1, 1);
```
### usePlugin ### usePlugin
- **参数:** - **参数:**

View File

@ -10,6 +10,8 @@ node.js > 14
推荐使用 npm 的方式安装,它能更好地和 [webpack](https://webpack.js.org/) 打包工具配合使用。 推荐使用 npm 的方式安装,它能更好地和 [webpack](https://webpack.js.org/) 打包工具配合使用。
> 使用Vue CLI生成的项目需要在vue.config.js中加上配置transpileDependencies: [/@tmagic/]
```bash ```bash
# 最新稳定版 # 最新稳定版
$ npm install @tmagic/editor@latest -S $ npm install @tmagic/editor@latest -S