mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix(amis-editor): 优化删除快捷键执行逻辑 (#8584)
* fix(amis-editor): flex布局容器的主轴排列方式配置默认用center,和flex组件默认样式保持一致 * fix(amis-editor): 优化删除快捷键执行逻辑
This commit is contained in:
parent
aa8972d7ea
commit
3e56f5f7c1
@ -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('当前元素不允许删除。');
|
||||
|
@ -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
|
||||
}),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user