From db43f587a67b2b5f955374a8f93783c9e9ae81a8 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Tue, 18 Mar 2025 20:42:32 -0400 Subject: [PATCH] [TS] Fix ts-strict errors in Vue components (Part 4) (#3134) --- src/components/common/TreeExplorer.vue | 2 +- src/components/common/UrlInput.vue | 4 +- .../dialog/content/SettingDialogContent.vue | 2 +- src/components/graph/DomWidgets.vue | 4 +- src/components/graph/SelectionOverlay.vue | 2 +- .../selectionToolbox/ColorPickerButton.vue | 2 +- src/components/install/GpuPicker.vue | 2 +- .../install/InstallLocationPicker.vue | 4 +- .../install/MirrorsConfiguration.vue | 4 +- .../sidebar/tabs/nodeLibrary/NodeTreeLeaf.vue | 3 +- .../tabs/queue/__tests__/ResultGallery.ts | 82 ------------------- 11 files changed, 15 insertions(+), 96 deletions(-) delete mode 100644 src/components/sidebar/tabs/queue/__tests__/ResultGallery.ts diff --git a/src/components/common/TreeExplorer.vue b/src/components/common/TreeExplorer.vue index 5ef0f891ed..29dcd0bc33 100644 --- a/src/components/common/TreeExplorer.vue +++ b/src/components/common/TreeExplorer.vue @@ -131,7 +131,7 @@ const onNodeContentClick = async ( } emit('nodeClick', node, e) } -const menu = ref(null) +const menu = ref | null>(null) const menuTargetNode = ref(null) const extraMenuItems = computed(() => { return menuTargetNode.value?.contextMenuItems diff --git a/src/components/common/UrlInput.vue b/src/components/common/UrlInput.vue index 7e9817b16d..9e400ae93a 100644 --- a/src/components/common/UrlInput.vue +++ b/src/components/common/UrlInput.vue @@ -68,9 +68,9 @@ onMounted(async () => { await validateUrl(props.modelValue) }) -const handleInput = (value: string) => { +const handleInput = (value: string | undefined) => { // Update internal value without emitting - internalValue.value = cleanInput(value) + internalValue.value = cleanInput(value ?? '') // Reset validation state when user types validationState.value = ValidationState.IDLE } diff --git a/src/components/dialog/content/SettingDialogContent.vue b/src/components/dialog/content/SettingDialogContent.vue index 82e15874bd..75ded5b9f2 100644 --- a/src/components/dialog/content/SettingDialogContent.vue +++ b/src/components/dialog/content/SettingDialogContent.vue @@ -31,7 +31,7 @@