fix: 行列容器组件纵向分割大于2的时候报错 (#474)

* fix: 行列容器组件纵向分割大于2的时候报错
This commit is contained in:
Gene 2024-05-16 20:41:10 -07:00 committed by GitHub
parent 0d36df07a7
commit 47c71d1129
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 12 deletions

View File

@ -43,7 +43,8 @@ const ROW_SNIPPET = {
grow: true,
shrink: true,
widthType: 'auto'
}
},
children: []
}
]
}
@ -103,16 +104,7 @@ export default {
if (schema.componentName === 'CanvasCol') {
//
if (!schema.children?.length) {
schema.children = [
{
...extend(true, {}, ROW_SNIPPET),
children: [{ ...extend(true, {}, COL_SNIPPET) }]
},
{
...extend(true, {}, ROW_SNIPPET),
children: [{ ...extend(true, {}, COL_SNIPPET) }]
}
]
schema.children = [extend(true, {}, ROW_SNIPPET), extend(true, {}, ROW_SNIPPET)]
} else if (schema.children[0].componentName !== 'CanvasRow') {
// row children row col
schema.children = [
@ -129,7 +121,7 @@ export default {
]
} else {
//
schema.children.push(...extend(true, {}, ROW_SNIPPET))
schema.children.push(extend(true, {}, ROW_SNIPPET))
}
}