fix: 处理无数据删除会报错的bug

This commit is contained in:
奔跑的面条
2022-08-16 21:06:55 +08:00
parent 57be88e8aa
commit 5dd6f88a42
2 changed files with 16 additions and 4 deletions
@@ -95,7 +95,7 @@ const labelHandle = (e: HistoryItemType) => {
return historyActionTypeName[HistoryTargetTypeEnum.CANVAS]
} else if (e.actionType === HistoryActionTypeEnum.GROUP) {
return `${historyActionTypeName[e.actionType]}`
} else {
} else if (e.historyData.length) {
return `${historyActionTypeName[e.actionType]} - ${(e.historyData[0] as CreateComponentType).chartConfig.title}`
}
}
@@ -108,7 +108,10 @@ const options = computed(() => {
icon: iconHandle(e)
}
})
return reverse(options)
return reverse(options.filter(item => {
return item.label
}))
})
</script>