Skip to content

Commit

Permalink
docs: 完善文档
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen authored and jia000 committed May 7, 2022
1 parent 88cc033 commit 10349fb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
11 changes: 11 additions & 0 deletions docs/src/api/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,17 @@ import { ArrowLeft, Coin } from '@element-plus/icons';
- **详情:**

画布中的选中框配置选项,使用的是[moveable](https://github.com/daybrush/moveable)第三方库

### stageRect

- **类型:** { width: number; height: number }

- **默认值:** { width: 375, height: 817 }

- **详情:**

画布的大小配置

## slots

### nav
Expand Down
32 changes: 26 additions & 6 deletions docs/src/api/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,11 @@ const node = editorService.get('node');
editorService.alignCenter(node);
```

- ### swap
- ### moveLayer

- **参数:**

- `{number | 'latest' | 'first'` offset
- `{number | 'top' | 'bottom'` offset

- **用法:**

Expand All @@ -352,10 +352,10 @@ editorService.alignCenter(node);
```js
import { editorService } from '@tmagic/editor';
editorService.swap('bottom'); // 置底
editorService.swap('first'); // 置顶
editorService.swap(1); // 上移一层
editorService.swap(-1); // 下移一层
editorService.moveLayer('top'); // 置底
editorService.moveLayer('bottom'); // 置顶
editorService.moveLayer(1); // 上移一层
editorService.moveLayer(-1); // 下移一层
```

- ### undo
Expand Down Expand Up @@ -394,6 +394,26 @@ import { editorService } from '@tmagic/editor';
editorService.redo();
```

- ### move

- **参数:**

- `{number}` left
- `{number}` top


- **用法:**

绝对定位布局下,移动组件位置

- **示例:**

```js
import { editorService } from '@tmagic/editor';
editorService.move(1, 1);
```

### usePlugin

- **参数:**
Expand Down
2 changes: 2 additions & 0 deletions docs/src/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ node.js > 14

推荐使用 npm 的方式安装,它能更好地和 [webpack](https://webpack.js.org/) 打包工具配合使用。

> 使用Vue CLI生成的项目需要在vue.config.js中加上配置:transpileDependencies: [/@tmagic/]
```bash
# 最新稳定版
$ npm install @tmagic/editor@latest -S
Expand Down

0 comments on commit 10349fb

Please sign in to comment.