fix: 修复 mobx 数组元素在获取超出边界时报错

This commit is contained in:
lihao.ylh 2021-09-16 16:12:29 +08:00
parent 0672f3b8cc
commit f4e07fe290
2 changed files with 7 additions and 2 deletions

View File

@ -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;
}
/**

View File

@ -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
*/