diff --git a/docs/src/api/editor.md b/docs/src/api/editor.md index 50c98d91f..5cfbf2351 100644 --- a/docs/src/api/editor.md +++ b/docs/src/api/editor.md @@ -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 diff --git a/docs/src/api/model.md b/docs/src/api/model.md index 8ffe5a2b4..9fe7e41ea 100644 --- a/docs/src/api/model.md +++ b/docs/src/api/model.md @@ -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 - **参数:** diff --git a/docs/src/guide/installation.md b/docs/src/guide/installation.md index 1b8f14b44..5c6173211 100644 --- a/docs/src/guide/installation.md +++ b/docs/src/guide/installation.md @@ -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