Skip to content

Commit

Permalink
fix: 隐藏画布根节点的包裹元素的操作选项
Browse files Browse the repository at this point in the history
  • Loading branch information
gene9831 committed May 17, 2024
1 parent 899d616 commit 17829ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/canvas/src/components/container/CanvasAction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,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'
})
Expand Down
3 changes: 2 additions & 1 deletion packages/canvas/src/components/render/RenderMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ export default {
// 渲染画布增加根节点,与出码和预览保持一致
const rootChildrenSchema = {
componentName: 'div',
props: schema.props,
// 手动添加一个唯一的属性,后续在画布选中此节点时方便处理额外的逻辑。由于没有修改schema,不会影响出码
props: { ...schema.props, 'data-id': 'root-container' },
children: schema.children
}

Expand Down

0 comments on commit 17829ab

Please sign in to comment.