diff --git a/src/data/component-list.js b/src/data/component-list.js index 75155de..99faf26 100644 --- a/src/data/component-list.js +++ b/src/data/component-list.js @@ -3,26 +3,89 @@ let list = [ name: "a-button", describe: "按钮", type: "component", - slot: [{ type: "text", text: "按钮" }], + child: [{ type: "text", text: "按钮" }], props: {}, id: "customID", style: { - color: 'red', + color: "red", left: 0, top: 0, width: 80, height: 32, - zIndex: 1 + zIndex: 1, + }, + }, + { + name: "a-button", + describe: "插槽按钮", + type: "component", + drag: true, + dragevent: true, + child: [ + { + type: "component", + name: "a-button", + props: { }, + child: [{ type: "text", text: "插槽按钮" }], + }, + ], + props: {}, + id: "customID2", + style: { + color: "red", + left: 0, + top: 0, + width: 80, + height: 32, + zIndex: 1, + }, + }, + { + name: "a-row", + describe: "row", + type: "component", + drag: true, + + child: [ + { + type: "component", + name: "a-col", + dragevent: true, + props: { }, + child: [ + { + type: "component", + name: "a-button", + props: { }, + child: [{ type: "text", text: "插槽按钮" }], + }, + ], + style: { + width: 200, + height: 100, + zIndex: 1, + }, + }, + ], + props: {}, + id: "custom3ID2", + style: { + color: "red", + left: 0, + top: 0, + width: 200, + height: 200, + zIndex: 1, }, }, { name: "img", describe: "图片", type: "component", - slot: [], + child: [], props: { - draggable:"false", - src: 'https://scpic.chinaz.net/files/pic/pic9/202101/bpic22299.jpg' + draggable: "false", + src: "https://scpic.chinaz.net/files/pic/pic9/202101/bpic22299.jpg", }, id: "imgID", style: { @@ -36,7 +99,7 @@ let list = [ name: "a-avatar", describe: "图片", type: "component", - slot: [], + child: [], props: { icon: "user", }, @@ -52,9 +115,9 @@ let list = [ name: "a-input", describe: "输入框", type: "component", - slot: [], + child: [], props: { - placeholder:'请输入' + placeholder: "请输入", }, id: "inputID", style: { @@ -68,11 +131,11 @@ let list = [ name: "a-tooltip", describe: "tooltip", type: "component", - slot: [ + child: [ { name: "a-button", type: "component", - slot: [{ type: "text", text: "阿萨大" }], + child: [{ type: "text", text: "阿萨大" }], props: {}, style: { left: 0, @@ -95,7 +158,7 @@ let list = [ name: "a-cascader", describe: "级联选择", type: "component", - slot: [], + child: [], props: { options: [ { @@ -147,9 +210,9 @@ let list = [ }, }, ]; -list = list.map(v=>{ +list = list.map((v) => { v.origin = JSON.parse(JSON.stringify(v.style)); - return v -}) + return v; +}); export default list; diff --git a/src/main.js b/src/main.js index 69cfa58..4a41e6e 100644 --- a/src/main.js +++ b/src/main.js @@ -14,6 +14,9 @@ Vue.config.productionTip = process.env.NODE_ENV === 'production' ? true : false; Vue.use(toast); Vue.prototype.$computeStyle= function(style,isDefault=false){ + if(!style){ + return {} + } let myStyle = cloneDeep(style); let attr = ["left", "width", "height", "top", "right", "bottom"]; let attrStr = ["backgroundColor", "color","position",'zIndex']; diff --git a/src/ui/detail/detail.vue b/src/ui/detail/detail.vue index 99886e9..c2dcef7 100644 --- a/src/ui/detail/detail.vue +++ b/src/ui/detail/detail.vue @@ -3,6 +3,7 @@
+
{{ currentDetail }}--{{ currentIndex }} diff --git a/src/ui/editor/Shape.vue b/src/ui/editor/Shape.vue index 592dc6d..f070fba 100644 --- a/src/ui/editor/Shape.vue +++ b/src/ui/editor/Shape.vue @@ -38,7 +38,7 @@