mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +00:00
feat: 提供画布 lock 的开关
This commit is contained in:
parent
3994b18877
commit
57a6d8c375
@ -13,7 +13,7 @@ import {
|
||||
LiveTextEditingConfig,
|
||||
FieldConfig,
|
||||
} from '@ali/lowcode-types';
|
||||
import { computed } from '@ali/lowcode-editor-core';
|
||||
import { computed, engineConfig } from '@ali/lowcode-editor-core';
|
||||
import EventEmitter from 'events';
|
||||
|
||||
import { isNode, Node, ParentalNode } from './document';
|
||||
@ -479,7 +479,7 @@ const builtinComponentActions: ComponentAction[] = [
|
||||
},
|
||||
condition: (node: Node) => {
|
||||
const isLocked = node.getExtraProp('isLocked')?.getValue();
|
||||
return (node.isContainer() && isLocked !== true);
|
||||
return (engineConfig.get('enableCanvasLock', false) && node.isContainer() && isLocked !== true);
|
||||
},
|
||||
important: true,
|
||||
},
|
||||
@ -494,7 +494,7 @@ const builtinComponentActions: ComponentAction[] = [
|
||||
},
|
||||
condition: (node: Node) => {
|
||||
const isLocked = node.getExtraProp('isLocked')?.getValue();
|
||||
return (node.isContainer() && isLocked === true);
|
||||
return (engineConfig.get('enableCanvasLock', false) && node.isContainer() && isLocked === true);
|
||||
},
|
||||
important: true,
|
||||
},
|
||||
|
||||
@ -51,6 +51,10 @@ export interface EngineOptions {
|
||||
* 禁止默认的设置器,默认值:false
|
||||
*/
|
||||
disableDefaultSetters: boolean;
|
||||
/**
|
||||
* 打开画布的锁定操作,默认值:false
|
||||
*/
|
||||
enableCanvasLock: boolean;
|
||||
/**
|
||||
* Vision-polyfill settings
|
||||
*/
|
||||
|
||||
@ -178,7 +178,6 @@ export async function init(container?: Element, options?: EngineOptions) {
|
||||
}
|
||||
}
|
||||
engineContainer.id = 'engine';
|
||||
|
||||
engineConfig.setConfig(engineOptions as any);
|
||||
|
||||
await plugins.init();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user