Skip to content

Commit

Permalink
fix(editor): 已选组件树中如果出现items不是数组会导致节点渲染失败
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen committed May 30, 2024
1 parent 7dad247 commit 7fb4d96
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/editor/src/components/TreeNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ const selected = computed(() => nodeStatus.value.selected);
const visible = computed(() => nodeStatus.value.visible);
const draggable = computed(() => nodeStatus.value.draggable);
const hasChildren = computed(() => props.data.items?.some((item) => props.nodeStatusMap.get(item.id)?.visible));
const hasChildren = computed(
() => Array.isArray(props.data.items) && props.data.items.some((item) => props.nodeStatusMap.get(item.id)?.visible),
);
const handleDragStart = (event: DragEvent) => {
treeEmit?.('node-dragstart', event, props.data);
Expand Down

0 comments on commit 7fb4d96

Please sign in to comment.