diff --git a/packages/amis-editor-core/scss/editor.scss b/packages/amis-editor-core/scss/editor.scss index e58b5fef5..58dd46f12 100644 --- a/packages/amis-editor-core/scss/editor.scss +++ b/packages/amis-editor-core/scss/editor.scss @@ -588,7 +588,8 @@ height: 20px; line-height: 20px; border-radius: 20px; - top: 20%; + top: 50%; + transform: translate(0, -50%); > span > svg { width: 12px; diff --git a/packages/amis-editor-core/src/manager.ts b/packages/amis-editor-core/src/manager.ts index 0c2103f7d..ff212b115 100644 --- a/packages/amis-editor-core/src/manager.ts +++ b/packages/amis-editor-core/src/manager.ts @@ -869,6 +869,9 @@ export class EditorManager { if (!regionNode.region && regionNode.schema.body) { // 默认插入到父节点的body中 regionNodeRegion = 'body'; + } else if (!regionNode.region && regionNode.schema?.type === 'flex' && regionNode.schema.items) { + // flex布局容器 + regionNodeRegion = 'items'; } else if (!regionNode.region && !regionNode.schema.body) { // 其他特殊情况暂时不考虑,给予提示 toast.warning('当前节点不允许追加新组件。'); diff --git a/packages/amis-editor-core/src/store/editor.ts b/packages/amis-editor-core/src/store/editor.ts index bc69ce415..b428e2931 100644 --- a/packages/amis-editor-core/src/store/editor.ts +++ b/packages/amis-editor-core/src/store/editor.ts @@ -852,6 +852,7 @@ export const EditorStore = types return idx < self.schemaHistory.length - 1; }, + // 判断是否时布局容器中的列级元素 isFlexItem(id: string) { const activeId = id || self.activeId; const parentSchema = this.getSchemaParentById(activeId, true);