Steps

Demos

Current step

Options

<template>
<article>
  <section>
    <h4>Current step</h4>
    <veui-number-input
      v-model="current"
      :min="1"
      :max="steps.length"
      :step="1"
    />
  </section>
  <section>
    <h4>Options</h4>
    <veui-checkbox v-model="full">
      Full
    </veui-checkbox>
    <veui-checkbox v-model="small">
      Small
    </veui-checkbox>
    <veui-checkbox v-model="vertical">
      Verticle
    </veui-checkbox>
  </section>
  <section>
    <veui-steps
      :ui="ui"
      :steps="steps"
      :current="current - 1"
    />
  </section>
</article>
</template>

<script>
import { Steps, NumberInput, Checkbox } from 'veui'

export default {
  components: {
    'veui-steps': Steps,
    'veui-number-input': NumberInput,
    'veui-checkbox': Checkbox
  },
  data () {
    return {
      current: 1,
      full: false,
      small: false,
      vertical: false,
      steps: [
        { label: 'Step 1', desc: '填写信息' },
        { label: 'Step 2', desc: '验证身份' },
        { label: 'Step 3', desc: '注册成功' }
      ]
    }
  },
  computed: {
    ui () {
      return [
        ...(this.full ? ['full'] : []),
        ...(this.vertical ? ['vertical'] : []),
        ...(this.small ? ['small'] : [])
      ].join(' ')
    }
  }
}
</script>

API

Props

NameTypeDefaultDescription
uistring-

Style variants.

ValueDescription
fullFull style.
smallSmall style.
verticalVertical style.
stepsArray-

The datasource of steps with item type being { label, desc, to }.

NameType
labelstringThe label of the step.
descstringThe description of the step.
tostring|ObjectThe target link of the step. The type is the same as the to prop of Link component.
currentnumber-The index of current step.

Slots

NameDescription
default

The content of each step. Displays the step index/completed icon, label and description by default.

NameTypeDescription
labelstringThe label of the step. Same as the label property from items of steps.
descstringThe description of the step. Same as the desc property from items of steps.
tostring|ObjectThe target link of the step. Same as the to property from items of steps.
indexnumberThe index of the step. (Starts from 0.)

Additionally, custom properties in current step, apart from the listed ones, will also be passes into the scope object via v-bind.

indexThe step index. Displays an index value starts from 1 and a success icon for finished steps by default. Resides inside the default slot and share the same scope properties.
labelThe step label. Displays the label prop by default. Resides inside the default slot and share the same scope properties.
descThe step description. Displays the desc prop by default. Resides inside the default slot and share the same scope properties.

Icons

NameDescription
successThe finished steps.