fix: 隐藏画布根节点的包裹元素的操作选项 (#492)

This commit is contained in:
Gene 2024-08-24 21:43:53 +08:00 committed by GitHub
parent 871463f185
commit c218724543
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -229,7 +229,10 @@ export default {
}
const showAction = computed(() => {
const { parent } = getCurrent()
const { schema, parent } = getCurrent()
if (schema?.props?.['data-id'] === 'root-container') {
return false
}
return !props.resize && parent && parent?.type !== 'JSSlot'
})

View File

@ -379,7 +379,8 @@ export default {
// 渲染画布增加根节点,与出码和预览保持一致
const rootChildrenSchema = {
componentName: 'div',
props: schema.props,
// 手动添加一个唯一的属性后续在画布选中此节点时方便处理额外的逻辑。由于没有修改schema不会影响出码
props: { ...schema.props, 'data-id': 'root-container' },
children: schema.children
}