diff --git a/README.md b/README.md index 48ceee16..519db98a 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 00000000..ad579756 --- /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 8a72c58b..79418973 100644 --- a/playground/src/pages/Editor.vue +++ b/playground/src/pages/Editor.vue @@ -27,16 +27,8 @@