Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
feat(Stepper): set StepperState by automatically for non-custom stepper
Browse files Browse the repository at this point in the history
  • Loading branch information
lukicenturi authored Dec 28, 2023
1 parent 3164265 commit e10948b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/steppers/Stepper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defineOptions({
});
const props = withDefaults(defineProps<Props>(), {
step: 0,
step: undefined,
iconTop: false,
custom: false,
titleClass: '',
Expand All @@ -39,12 +39,14 @@ const { custom, steps, step, orientation, keepActiveVisible } = toRefs(props);
// automatically set step state to custom stepper.
const renderedStep = computed(() => {
if (!get(custom)) {
return get(steps);
const currentStep = get(step);
const stepsVal = get(steps);
if (!isDefined(currentStep)) {
return stepsVal;
}
const currentStep = get(step);
return get(steps).map((text, index) => {
return stepsVal.map((text, index) => {
let stepStatus: StepperState = StepperState.inactive;
if (index + 1 === currentStep) {
Expand Down

0 comments on commit e10948b

Please sign in to comment.