mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-19 12:14:27 +08:00
docs: 完善文档
This commit is contained in:
parent
88cc033e0d
commit
10349fb453
@ -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
|
||||
|
@ -337,11 +337,11 @@ const node = editorService.get('node');
|
||||
editorService.alignCenter(node);
|
||||
```
|
||||
|
||||
- ### swap
|
||||
- ### moveLayer
|
||||
|
||||
- **参数:**
|
||||
|
||||
- `{number | 'latest' | 'first'` offset
|
||||
- `{number | 'top' | 'bottom'` offset
|
||||
|
||||
- **用法:**
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
- **参数:**
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user