mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 11:09:21 +00:00
fix: fixed focusNodeSelector configuration not taking effect
This commit is contained in:
parent
ca7972c9a7
commit
9beae9c326
@ -1,4 +1,4 @@
|
|||||||
import { computed, makeObservable, obx, action, runWithGlobalEventOff, wrapWithEventSwitch } from '@alilc/lowcode-editor-core';
|
import { makeObservable, obx, engineConfig, action, runWithGlobalEventOff, wrapWithEventSwitch } from '@alilc/lowcode-editor-core';
|
||||||
import { NodeData, isJSExpression, isDOMText, NodeSchema, isNodeSchema, RootSchema, PageSchema, ComponentsMap } from '@alilc/lowcode-types';
|
import { NodeData, isJSExpression, isDOMText, NodeSchema, isNodeSchema, RootSchema, PageSchema, ComponentsMap } from '@alilc/lowcode-types';
|
||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
import { Project } from '../project';
|
import { Project } from '../project';
|
||||||
@ -87,7 +87,7 @@ export class DocumentModel {
|
|||||||
if (this._drillDownNode) {
|
if (this._drillDownNode) {
|
||||||
return this._drillDownNode;
|
return this._drillDownNode;
|
||||||
}
|
}
|
||||||
const selector = this.designer.editor?.get<((rootNode: RootNode) => Node) | null>('focusNodeSelector');
|
const selector = engineConfig.get('focusNodeSelector');
|
||||||
if (selector && typeof selector === 'function') {
|
if (selector && typeof selector === 'function') {
|
||||||
return selector(this.rootNode!);
|
return selector(this.rootNode!);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -141,6 +141,10 @@ const VALID_ENGINE_OPTIONS = {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: '当开启组件未找到严格模式时,渲染模块不会默认给一个容器组件',
|
description: '当开启组件未找到严格模式时,渲染模块不会默认给一个容器组件',
|
||||||
},
|
},
|
||||||
|
focusNodeSelector: {
|
||||||
|
type: 'function',
|
||||||
|
description: '配置指定节点为根组件',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
export interface EngineOptions {
|
export interface EngineOptions {
|
||||||
/**
|
/**
|
||||||
@ -268,6 +272,11 @@ export interface EngineOptions {
|
|||||||
* 当开启组件未找到严格模式时,渲染模块不会默认给一个容器组件
|
* 当开启组件未找到严格模式时,渲染模块不会默认给一个容器组件
|
||||||
*/
|
*/
|
||||||
enableStrictNotFoundMode?: boolean;
|
enableStrictNotFoundMode?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置指定节点为根组件
|
||||||
|
*/
|
||||||
|
focusNodeSelector?: (rootNode: Node) => Node;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getStrictModeValue = (engineOptions: EngineOptions, defaultValue: boolean): boolean => {
|
const getStrictModeValue = (engineOptions: EngineOptions, defaultValue: boolean): boolean => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user