From 7e993cab73aa10df8f9c7e75a3220680b6f8adcf Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 11 Feb 2025 16:44:05 +0100 Subject: [PATCH] refactor: refs #6897 improve condition checks in VnTable and remove unused emit in VnInputTime for cleaner code --- src/components/VnTable/VnTable.vue | 8 ++++---- src/components/common/VnInputTime.vue | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 630b50d20..7e0757f6c 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -351,12 +351,12 @@ const clickHandler = async (event) => { const colField = clickedElement.getAttribute('data-col-field'); const column = $props.columns.find((col) => col.name === colField); - if (editingRow.value != null && editingField.value != null) { - if (editingRow.value == rowIndex && editingField.value == colField) { + if (editingRow.value !== null && editingField.value !== null) { + if (editingRow.value === rowIndex && editingField.value === colField) { return; - } else { - destroyInput(editingRow.value, editingField.value); } + + destroyInput(editingRow.value, editingField.value); } if (isEditableColumn(column)) await renderInput(Number(rowIndex), colField, clickedElement); diff --git a/src/components/common/VnInputTime.vue b/src/components/common/VnInputTime.vue index 7a006d0e1..323427f5b 100644 --- a/src/components/common/VnInputTime.vue +++ b/src/components/common/VnInputTime.vue @@ -23,7 +23,6 @@ const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])]; const dateFormat = 'HH:mm'; const isPopupOpen = ref(); const hover = ref(); -const emit = defineEmits(['blur']); const styleAttrs = computed(() => { return props.isOutlined