From f4e07fe2905613b48d87fb51c78a52ea65716d07 Mon Sep 17 00:00:00 2001 From: "lihao.ylh" Date: Thu, 16 Sep 2021 16:12:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20mobx=20=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E5=85=83=E7=B4=A0=E5=9C=A8=E8=8E=B7=E5=8F=96=E8=B6=85?= =?UTF-8?q?=E5=87=BA=E8=BE=B9=E7=95=8C=E6=97=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/designer/src/document/node/node-children.ts | 2 +- packages/editor-core/src/config.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/designer/src/document/node/node-children.ts b/packages/designer/src/document/node/node-children.ts index bc37cfd20..fa6af31e5 100644 --- a/packages/designer/src/document/node/node-children.ts +++ b/packages/designer/src/document/node/node-children.ts @@ -250,7 +250,7 @@ export class NodeChildren { * 根据索引获得节点 */ get(index: number): Node | null { - return this.children[index] || null; + return this.children.length > index ? this.children[index] : null; } /** diff --git a/packages/editor-core/src/config.ts b/packages/editor-core/src/config.ts index a697ab2d5..5b049df07 100644 --- a/packages/editor-core/src/config.ts +++ b/packages/editor-core/src/config.ts @@ -1,4 +1,5 @@ -import lodashGet from 'lodash.get'; +import { ComponentType } from 'react'; +import { get as lodashGet } from 'lodash'; export interface EngineOptions { /** @@ -59,6 +60,10 @@ export interface EngineOptions { * 当选中节点切换时,是否停留在相同的设置 tab 上,默认值:false */ stayOnTheSameSettingTab?: boolean; + /** + * 自定义 loading 组件 + */ + loadingComponent?: ComponentType; /** * Vision-polyfill settings */