Calculate step when there is no start badge

This commit is contained in:
Daniel Egger 2023-05-09 11:04:01 +02:00
parent 02d637f971
commit 726d5dc9bd
1 changed files with 8 additions and 1 deletions

View File

@ -50,6 +50,13 @@ const endBadgeClasses = computed(() => {
}
return "border";
});
function calcStepIndex(step: number) {
if (props.startBadgeText) {
return step + 1;
}
return step;
}
</script>
<template>
@ -75,7 +82,7 @@ const endBadgeClasses = computed(() => {
>
<router-link
v-if="props.baseUrl"
:to="`${props.baseUrl}?${props.queryParam}=${step + 1}`"
:to="`${props.baseUrl}?${props.queryParam}=${calcStepIndex(step)}`"
>
{{ step + 1 }}
</router-link>