diff --git a/src/components/common/TreeExplorer.vue b/src/components/common/TreeExplorer.vue index 7343f5c69..d91ab9e8c 100644 --- a/src/components/common/TreeExplorer.vue +++ b/src/components/common/TreeExplorer.vue @@ -386,11 +386,11 @@ const onNodeContentClick = async ( const menu = ref | null>(null) const menuTargetNode = ref(null) const extraMenuItems = computed(() => { - return menuTargetNode.value?.contextMenuItems - ? typeof menuTargetNode.value.contextMenuItems === 'function' - ? menuTargetNode.value.contextMenuItems(menuTargetNode.value) - : menuTargetNode.value.contextMenuItems - : [] + const contextMenuItems = menuTargetNode.value?.contextMenuItems + if (!contextMenuItems) return [] + return typeof contextMenuItems === 'function' + ? contextMenuItems(menuTargetNode.value!) + : contextMenuItems }) const renameEditingNode = ref(null) const handleNodeLabelEdit = async (