diff --git a/src/components/TabComponent.vue b/src/components/TabComponent.vue index 6a0cf7b3..35c248e7 100644 --- a/src/components/TabComponent.vue +++ b/src/components/TabComponent.vue @@ -37,8 +37,11 @@ function addData() { } function close(index: number) { - console.log(customerBranch.value.length, index); - if (customerBranch.value.length - 1 === index) { + if (customerBranch.value.length === 1) return; + + if (customerBranch.value.length === index + 1) { + tab.value = tab.value - 1; + } else if (tab.value >= index) { tab.value = tab.value - 1; } @@ -66,7 +69,7 @@ function close(index: number) { :key="index" :name="index" :label="`${$t('customerBranchFormTab')} ${index + 1}`" - @click="tab = index" + @click="(tab = index), console.log(customerBranch)" no-caps >