2024-08-26 19:09:43 +00:00
|
|
|
<!-- eslint-disable vue/multi-word-component-names -->
|
2023-01-31 22:31:27 +00:00
|
|
|
<template>
|
|
|
|
|
<nav class="breadcrumb has-succeeds-separator">
|
|
|
|
|
<ul>
|
2023-09-07 01:17:14 +00:00
|
|
|
<li
|
|
|
|
|
v-for="(step, index) in steps"
|
2024-08-26 19:09:43 +00:00
|
|
|
:key="index"
|
2023-09-07 01:17:14 +00:00
|
|
|
:class="modelValue === index ? 'is-active' : ''"
|
2023-09-07 02:12:17 +00:00
|
|
|
@click.left="change_step(index)"
|
2023-09-07 01:17:14 +00:00
|
|
|
>
|
2023-01-31 22:31:27 +00:00
|
|
|
<a>
|
|
|
|
|
<span class="icon is-small">
|
2024-08-26 19:09:43 +00:00
|
|
|
<FontAwesomeIcon :icon="step.icon" />
|
2023-01-31 22:31:27 +00:00
|
|
|
</span>
|
|
|
|
|
<span>{{ step.label }}</span>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</nav>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-08-26 19:09:43 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { Step } from "@/lib/helpers";
|
2023-01-31 22:31:27 +00:00
|
|
|
|
2024-08-26 19:09:43 +00:00
|
|
|
const props = defineProps<{
|
|
|
|
|
steps: Step[];
|
|
|
|
|
modelValue: number;
|
|
|
|
|
}>();
|
2023-01-31 22:31:27 +00:00
|
|
|
|
2024-08-26 19:09:43 +00:00
|
|
|
const emit = defineEmits<{
|
|
|
|
|
"update:modelValue": [number];
|
|
|
|
|
}>();
|
2023-01-31 22:31:27 +00:00
|
|
|
|
2024-08-26 19:09:43 +00:00
|
|
|
function change_step(next_step: number) {
|
|
|
|
|
if (next_step === props.modelValue) return;
|
2023-01-31 22:31:27 +00:00
|
|
|
|
2024-08-26 19:09:43 +00:00
|
|
|
emit("update:modelValue", next_step);
|
2023-01-31 22:31:27 +00:00
|
|
|
}
|
2023-09-07 01:17:14 +00:00
|
|
|
</script>
|