mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-05-08 03:16:39 +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 不能为数组');
|
throw new Error('root 不能为数组');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isObject(value) && !(value instanceof StageCore) && !(value instanceof Map)) {
|
if (value && isObject(value) && !(value instanceof StageCore) && !(value instanceof Map)) {
|
||||||
this.state.pageLength = value.items.length;
|
this.state.pageLength = value.items?.length || 0;
|
||||||
} else {
|
} else {
|
||||||
this.state.pageLength = 0;
|
this.state.pageLength = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user