From 10349fb453759c3198cd3997c3f9c6e39da4f249 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Sat, 7 May 2022 16:51:52 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=AE=8C=E5=96=84=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/src/api/editor.md | 11 +++++++++++ docs/src/api/model.md | 32 ++++++++++++++++++++++++++------ docs/src/guide/installation.md | 2 ++ 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/docs/src/api/editor.md b/docs/src/api/editor.md index 50c98d91..5cfbf235 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 8ffe5a2b..9fe7e41e 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 1b8f14b4..5c617321 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