refactor(editor): 拖动添加组件,避免覆盖默认样式

This commit is contained in:
roymondchen 2022-05-24 18:52:53 +08:00 committed by jia000
parent fbd7f80c4f
commit 64e751bdd8

View File

@ -209,6 +209,7 @@ export default defineComponent({
const { scrollTop, scrollLeft } = stage.mask;
if (layout === Layout.ABSOLUTE) {
config.style = {
...(config.style || {}),
position: 'absolute',
top: e.clientY - containerRect.top + scrollTop,
left: e.clientX - containerRect.left + scrollLeft,