From 311f400b756571f7a2fd544dcbcdec703425bbc5 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Mon, 13 Jun 2022 19:28:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(playground):=20=E6=B7=BB=E5=8A=A0form?= =?UTF-8?q?=E3=80=81table=20playground=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- playground/src/configs/componentGroupList.ts | 83 +++++++++++++ playground/src/{config.ts => configs/dsl.ts} | 0 playground/src/pages/Editor.vue | 123 ++++--------------- 4 files changed, 111 insertions(+), 97 deletions(-) create mode 100644 playground/src/configs/componentGroupList.ts rename playground/src/{config.ts => configs/dsl.ts} (100%) diff --git a/README.md b/README.md index 48ceee161..519db98a8 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ $ pnpm playground 最后在浏览器中打开 -http://localhost:8098/ +http://localhost:8098/tmagic-editor/playground/ 即可得到一个魔方编辑器示例项目 diff --git a/playground/src/configs/componentGroupList.ts b/playground/src/configs/componentGroupList.ts new file mode 100644 index 000000000..ad579756f --- /dev/null +++ b/playground/src/configs/componentGroupList.ts @@ -0,0 +1,83 @@ +import { FolderOpened, Grid, PictureFilled, SwitchButton, Tickets } from '@element-plus/icons'; + +export default [ + { + title: '示例容器', + items: [ + { + icon: FolderOpened, + text: '组', + type: 'container', + }, + { + icon: FolderOpened, + text: '蒙层', + type: 'overlay', + }, + ], + }, + { + title: '示例组件', + items: [ + { + icon: Tickets, + text: '文本', + type: 'text', + }, + { + icon: SwitchButton, + text: '按钮', + type: 'button', + }, + { + icon: PictureFilled, + text: '图片', + type: 'img', + }, + { + icon: Grid, + text: '二维码', + type: 'qrcode', + }, + ], + }, + { + title: '组合', + items: [ + { + icon: Tickets, + text: '弹窗', + data: { + type: 'overlay', + style: { + position: 'fixed', + width: '100%', + height: '100%', + top: 0, + left: 0, + backgroundColor: 'rgba(0, 0, 0, 0.8)', + }, + name: '弹窗', + items: [ + { + type: 'container', + style: { + position: 'absolute', + width: '80%', + height: '400', + top: '143.87', + left: 37.5, + backgroundColor: 'rgba(255, 255, 255, 1)', + backgroundRepeat: 'no-repeat', + backgroundSize: '100% 100%', + }, + name: '组', + items: [], + layout: 'absolute', + }, + ], + }, + }, + ], + }, +]; diff --git a/playground/src/config.ts b/playground/src/configs/dsl.ts similarity index 100% rename from playground/src/config.ts rename to playground/src/configs/dsl.ts diff --git a/playground/src/pages/Editor.vue b/playground/src/pages/Editor.vue index 8a72c58bb..794189737 100644 --- a/playground/src/pages/Editor.vue +++ b/playground/src/pages/Editor.vue @@ -27,16 +27,8 @@ + + diff --git a/playground/src/pages/Editor.vue b/playground/src/pages/Editor.vue index 794189737..f6a6d283c 100644 --- a/playground/src/pages/Editor.vue +++ b/playground/src/pages/Editor.vue @@ -12,7 +12,12 @@ :default-selected="defaultSelected" :moveable-options="moveableOptions" :auto-scroll-into-view="true" - > + :stage-rect="stageRect" + > + +