diff --git a/src/App.vue b/src/App.vue index 966ef71..b597fef 100644 --- a/src/App.vue +++ b/src/App.vue @@ -110,25 +110,27 @@ export default defineComponent({ "ruler": true, "background": {color:"#123456",opacity:0.1}, // "theme": "ddei-core-theme-black", - controls: [ - { - id: "act_1", - model: "102010", - code: "active_01", - text: "第一步", - border:{color:"yellow",dash:[10,10,5,5],width:5}, - fill:{color:"grey"}, - }, - { - id: "act_2", - model: "102010", - code: "active_02", - width: 200, - height: 100, - text: "第二步", - y: -70, - } - ] + initData: { + controls:[ + { + id: "act_1", + model: "102010", + code: "active_01", + text: "第一步", + border:{color:"yellow",dash:[10,10,5,5],width:5}, + fill:{color:"grey"}, + }, + { + id: "act_2", + model: "102010", + code: "active_02", + width: 200, + height: 100, + text: "第二步", + y: -70, + } + ] + } }, //配置扩展插件 extensions: [ @@ -144,24 +146,26 @@ export default defineComponent({ access:{"DEL":false}, "paper":"A5", "ruler": true, - controls: [ - { - id: "act_1", - model: "102010", - code: "active_01", - text: "第一步", - y: 70, - }, - { - id: "act_2", - model: "102010", - code: "active_02", - width: 200, - height: 100, - text: "第二步", - y: -70, - } - ] + initData: { + controls: [ + { + id: "act_1", + model: "102010", + code: "active_01", + text: "第一步", + y: 70, + }, + { + id: "act_2", + model: "102010", + code: "active_02", + width: 200, + height: 100, + text: "第二步", + y: -70, + } + ] + } }, //配置扩展插件 extensions: [ @@ -183,24 +187,26 @@ export default defineComponent({ EXT_STAGE_HEIGHT:false, ruler:0, grid: 0, - controls: [ - { - id: "rect_1", - model: "102010", - code: "active_01", - width: 200, - height: 100, - text: "第一步" - }, - { - id: "rect_2", - model: "102010", - code: "active_02", - width: 200, - height: 100, - text: "第二步" - } - ] + initData: { + controls: [ + { + id: "rect_1", + model: "102010", + code: "active_01", + width: 200, + height: 100, + text: "第一步" + }, + { + id: "rect_2", + model: "102010", + code: "active_02", + width: 200, + height: 100, + text: "第二步" + } + ] + } }, //配置扩展插件 extensions: [ diff --git a/src/editor/Editor.vue b/src/editor/Editor.vue index aed87fb..5dd8670 100644 --- a/src/editor/Editor.vue +++ b/src/editor/Editor.vue @@ -100,15 +100,15 @@ export default { DDeiEditorUtil.getControlIcons(this.editor); //初始化控件 - if(this.options?.config?.controls){ + if(this.options?.config?.initData){ //调用转换器,将输入内容转换为设计器能够识别的格式 - let controls = this.options?.config?.controls; - let converters = this.editor.getEnabledConverters(controls, 1); + let initData = this.options?.config?.initData + let converters = this.editor.getEnabledConverters(initData, 1); //依次调用converters converters?.forEach(converter => { - controls = converter.input(controls) + initData = converter.input(initData) }); - this.editor.addControls(controls) + this.editor.addControls(initData.controls) } if (this.options?.config?.access){ this.editor.setAccessInfo(this.options?.config?.access)