fix(amis-editor): 优化删除快捷键执行逻辑 (#8584)

* fix(amis-editor): flex布局容器的主轴排列方式配置默认用center,和flex组件默认样式保持一致

* fix(amis-editor): 优化删除快捷键执行逻辑
This commit is contained in:
刘丹 2023-11-02 09:10:42 +08:00 committed by GitHub
parent aa8972d7ea
commit 3e56f5f7c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -373,11 +373,16 @@ export default class Editor extends Component<EditorProps> {
// 删除快捷键
if (this.store.activeId) {
const node = store.getNodeById(this.store.activeId);
if (node && store.activeRegion) {
if (
node &&
store.activeRegion &&
node.info?.regions &&
node.info.regions.length > 1
) {
toast.warning('区域节点不可以直接删除。');
} else if (store.isRootSchema(this.store.activeId)) {
toast.warning('根节点不允许删除。');
} else if (node && node.moveable) {
} else if (node && (node.removable || node.removable === undefined)) {
this.manager.del(this.store.activeId);
} else {
toast.warning('当前元素不允许删除。');

View File

@ -107,7 +107,7 @@ export class FlexPluginBase extends LayoutBasePlugin {
getSchemaTpl('layout:flex-setting', {
label: '弹性布局设置',
direction: curRendererSchema.direction,
justify: curRendererSchema.justify,
justify: curRendererSchema.justify || 'center',
alignItems: curRendererSchema.alignItems
}),