forked from opentiny/tiny-engine
parent
0d36df07a7
commit
47c71d1129
|
@ -43,7 +43,8 @@ const ROW_SNIPPET = {
|
||||||
grow: true,
|
grow: true,
|
||||||
shrink: true,
|
shrink: true,
|
||||||
widthType: 'auto'
|
widthType: 'auto'
|
||||||
}
|
},
|
||||||
|
children: []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -103,16 +104,7 @@ export default {
|
||||||
if (schema.componentName === 'CanvasCol') {
|
if (schema.componentName === 'CanvasCol') {
|
||||||
// 当前组件为空组件,直接切成两行
|
// 当前组件为空组件,直接切成两行
|
||||||
if (!schema.children?.length) {
|
if (!schema.children?.length) {
|
||||||
schema.children = [
|
schema.children = [extend(true, {}, ROW_SNIPPET), extend(true, {}, ROW_SNIPPET)]
|
||||||
{
|
|
||||||
...extend(true, {}, ROW_SNIPPET),
|
|
||||||
children: [{ ...extend(true, {}, COL_SNIPPET) }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
...extend(true, {}, ROW_SNIPPET),
|
|
||||||
children: [{ ...extend(true, {}, COL_SNIPPET) }]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
} else if (schema.children[0].componentName !== 'CanvasRow') {
|
} else if (schema.children[0].componentName !== 'CanvasRow') {
|
||||||
// 当前组件不为空组件且第一个孩子不为 row,则是第一次切割,切割成两行,需要将原来有的 children 放置到第一个 row 的 col
|
// 当前组件不为空组件且第一个孩子不为 row,则是第一次切割,切割成两行,需要将原来有的 children 放置到第一个 row 的 col
|
||||||
schema.children = [
|
schema.children = [
|
||||||
|
@ -129,7 +121,7 @@ export default {
|
||||||
]
|
]
|
||||||
} else {
|
} else {
|
||||||
// 已经切割过了,直接加一行
|
// 已经切割过了,直接加一行
|
||||||
schema.children.push(...extend(true, {}, ROW_SNIPPET))
|
schema.children.push(extend(true, {}, ROW_SNIPPET))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue