Skip to content
Snippets Groups Projects
Commit c498a23c authored by mic29226's avatar mic29226
Browse files

final quickfix for tempRes

parent 718b6502
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,8 @@
</div>
<div class="dpiV3_tempAddMore">
<ButtonV3 :buttonText='$t("message.dataupload.datasets.dcat:temporalResolution.addMore")' size="medium"
iconStart="plus" variant="tertiary" @click="counter = counter + 1; timesList.push({ id: counter }); dynamicButtonText = t('message.dataupload.menu.delete')" />
iconStart="plus" variant="tertiary"
@click=" timesList.push({ id: timesList.length + 1 }); dynamicButtonText = t('message.dataupload.menu.delete')" />
</div>
</div>
......@@ -57,7 +58,7 @@ import { useI18n } from "vue-i18n";
const { t } = useI18n();
let checkboxState = ref([false]);
let timesList = ref([{ id: 0, 'dcat:startDate': "DD/MM/YYYY", 'dcat:endDate': "DD/MM/YYYY" }])
let counter = 0
const currentIndex = ref()
let dynamicButtonText = ref(t("message.dataupload.menu.reset"))
// Watcher für dynamische Aktualisierung
......@@ -73,14 +74,13 @@ const handleInput = (dateItem, index, key) => {
// ToDo
}
const removeIndex = (index) => {
if (index == 1) {
dynamicButtonText.value = t("message.dataupload.menu.reset");
}
// Verwende die ID des Objekts, um es zu entfernen
const idToRemove = timesList.value[index].id;
// Filtere das Array basierend auf der ID
timesList.value = timesList.value.filter(item => item.id !== idToRemove);
if (timesList.value.length === 1) {
dynamicButtonText.value = t("message.dataupload.menu.reset");
}
}
</script>
<style scoped>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment