Skip to content

Commit 2819a8e

Browse files
feat: 优化编辑器组件,简化模板结构,增强可读性和维护性,更新样式和事件处理逻辑
1 parent fbd6a0c commit 2819a8e

File tree

9 files changed

+759
-507
lines changed

9 files changed

+759
-507
lines changed

apps/playground/src/views/editor/index.vue

Lines changed: 302 additions & 375 deletions
Large diffs are not rendered by default.

packages/editor/src/components/layouts/props-editor.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const init = async(changeNode = false) => {
7777
customStyleSwitch: curStyleSwitch.value,
7878
customStyle: node.value?.style
7979
};
80+
console.log('formModel', formModel.value);
8081
});
8182
};
8283

packages/editor/src/props.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ export const defaultEditorProps = {
5353
children: [{
5454
'text': '容器',
5555
'component': 'container',
56-
icon: 'FolderOpenOutlined',
57-
},{
56+
icon: 'FolderOpenOutlined'
57+
}, {
5858
'text': '蒙层',
5959
'component': 'OverlayContainer',
6060
icon: 'FolderOpenOutlined',
@@ -65,35 +65,35 @@ export const defaultEditorProps = {
6565
height: '100%',
6666
top: 0,
6767
left: 0,
68-
backgroundColor: 'rgba(0, 0, 0, 0.8)',
69-
},
68+
backgroundColor: 'rgba(0, 0, 0, 0.8)'
69+
}
7070
}
71-
}],
72-
},{
71+
}]
72+
}, {
7373
/** 显示文案 */
7474
text: '基本组件',
7575
/** 组内列表 */
7676
children: [{
7777
'text': '按钮',
7878
'component': 'Button',
79-
icon: 'SelectOutlined',
79+
icon: 'SelectOutlined'
8080
}, {
8181
'text': '图片',
8282
'component': 'Img',
83-
icon: 'LinkOutlined',
83+
icon: 'LinkOutlined'
8484
}, {
8585
'text': '视频',
8686
'component': 'Video',
87-
icon: 'PlayCircleOutlined',
87+
icon: 'PlayCircleOutlined'
8888
}, {
8989
'text': '文本',
9090
'component': 'Text',
91-
icon: 'LineOutlined',
91+
icon: 'LineOutlined'
9292
}, {
9393
'text': '二维码',
9494
'component': 'Button',
95-
icon: 'SelectOutlined',
96-
}],
95+
icon: 'SelectOutlined'
96+
}]
9797
}],
9898
containerHighlightClassName: CONTAINER_HIGHLIGHT_CLASS_NAME,
9999
containerHighlightDuration: CONTAINER_HIGHLIGHT_DELAY_TIME,
@@ -104,15 +104,15 @@ export const defaultEditorProps = {
104104
style: {
105105
height: '100%',
106106
margin: '0 auto'
107-
},
107+
}
108108
},
109109
'container': {
110110
style: {
111-
height: '100',
112-
},
113-
},
111+
height: '100'
112+
}
113+
}
114114
}),
115115
propsConfigs: () => {},
116116
methodsList: () => {},
117-
datasourceList: () => [],
117+
datasourceList: () => []
118118
};

0 commit comments

Comments
 (0)