Skip to content

Commit

Permalink
chore(docs): update Steps doc
Browse files Browse the repository at this point in the history
- Strange errors of examples `ExSimple` and `ExDynamic` of `Steps`
  are fixed.
- In `docs/pages/components/steps/examples/ExSimple.vue`,
    - I got a maximum recursion exceeded error when the `type` prop
      of the second step "Profile" was directly bound to
      `{'is-success': isProfileSuccess}`. The error is not caused
      if the `type` prop value is given via a computed value
      `profileType`. I am not sure if this could be a bug of Vue 3.
- In `docs/pages/components/steps/examples/ExDynamic.vue`,
    - I got a maximum recursive exceeded error if the `visible` prop
      became `undefined`. The error is not caused if the `visible`
      prop is `true` or `false`. I am not sure if this could be a
      bug of Vue 3.
    - The new prop `order` is specified to maintain the ordering of
      items.
  • Loading branch information
kikuomax committed Jul 7, 2023
1 parent defe379 commit 93d22e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 5 additions & 4 deletions docs/pages/components/steps/examples/ExDynamic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
<b-switch v-model="showGames"> Show games item (by using the visible property) </b-switch>
</div>
<b-steps v-model="activeStep">
<template v-for="(step, index) in steps">
<template v-for="(step, index) in steps" :key="index">
<b-step-item
v-if="step.displayed"
:key="index"
:visible="step.visible"
:label="step.label">
:visible="step.visible !== undefined ? step.visible : true"
:label="step.label"
:order="index"
>
{{ step.content }}
</b-step-item>
</template>
Expand Down
10 changes: 9 additions & 1 deletion docs/pages/components/steps/examples/ExSimple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
Lorem ipsum dolor sit amet.
</b-step-item>

<b-step-item step="2" label="Profile" :clickable="isStepsClickable" :type="{'is-success': isProfileSuccess}">
<b-step-item step="2" label="Profile" :clickable="isStepsClickable" :type="profileType">
<h1 class="title has-text-centered">Profile</h1>
Lorem ipsum dolor sit amet.
</b-step-item>
Expand Down Expand Up @@ -130,6 +130,14 @@
labelPosition: 'bottom',
mobileMode: 'minimalist'
}
},
computed: {
profileType() {
// I got a maximum recursion exceeded error, if the following
// object is directly specified to the `type` prop of the
// "Profile" b-step-item.
return { 'is-success': this.isProfileSuccess }
}
}
}
</script>

0 comments on commit 93d22e9

Please sign in to comment.