polyfill getRoot

This commit is contained in:
kangwei 2020-04-20 16:01:22 +08:00
parent 208bccfcb9
commit 1e642089cb
2 changed files with 6 additions and 1 deletions

View File

@ -450,6 +450,11 @@ export class DocumentModel {
const config = parent.componentMeta;
return config.checkNestingDown(parent, obj) && this.checkNestingUp(parent, obj);
}
// ======= compatibles
getRoot() {
return this.rootNode;
}
}
export function isDocumentModel(obj: any): obj is DocumentModel {

View File

@ -469,7 +469,7 @@ export class Node {
// ======= compatibles ====
isEmpty(): boolean {
return this.children?.isEmpty() || true;
return this.children ? this.children.isEmpty() : true;
}
getStatus() {
return 'default';