mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(editor): set root 可能没有items
This commit is contained in:
parent
89fa321088
commit
aa566e9535
@ -108,8 +108,8 @@ class Editor extends BaseService {
|
||||
throw new Error('root 不能为数组');
|
||||
}
|
||||
|
||||
if (isObject(value) && !(value instanceof StageCore) && !(value instanceof Map)) {
|
||||
this.state.pageLength = value.items.length;
|
||||
if (value && isObject(value) && !(value instanceof StageCore) && !(value instanceof Map)) {
|
||||
this.state.pageLength = value.items?.length || 0;
|
||||
} else {
|
||||
this.state.pageLength = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user