[TS] Fix ts-strict errors in Vue components (Part 3) (#3126)

This commit is contained in:
Chenlei Hu
2025-03-18 11:38:43 -04:00
committed by GitHub
parent a85a1bf794
commit 96ff8a7785
18 changed files with 56 additions and 40 deletions

View File

@@ -194,7 +194,7 @@ const confirmRemoveAll = (event: Event) => {
})
}
const menu = ref(null)
const menu = ref<InstanceType<typeof ContextMenu> | null>(null)
const menuTargetTask = ref<TaskItemImpl | null>(null)
const menuTargetNode = ref<ComfyNode | null>(null)
const menuItems = computed<MenuItem[]>(() => [
@@ -213,7 +213,11 @@ const menuItems = computed<MenuItem[]>(() => [
{
label: t('g.goToNode'),
icon: 'pi pi-arrow-circle-right',
command: () => useLitegraphService().goToNode(menuTargetNode.value?.id),
command: () => {
if (!menuTargetNode.value) return
useLitegraphService().goToNode(menuTargetNode.value.id)
},
visible: !!menuTargetNode.value
}
])
@@ -225,7 +229,7 @@ const handleContextMenu = ({
}: {
task: TaskItemImpl
event: Event
node?: ComfyNode
node: ComfyNode | null
}) => {
menuTargetTask.value = task
menuTargetNode.value = node