2020-11-25 22:39:06 +08:00
..
2020-10-22 16:44:19 +08:00
2020-11-25 22:39:06 +08:00
2020-09-27 17:46:59 +08:00
2020-11-22 16:06:24 +08:00
2020-11-22 16:06:24 +08:00

Steps

Install

import { createApp } from 'vue';
import { Step, Steps } from 'vant';

const app = createApp();
app.use(Step);
app.use(Steps);

Usage

Basic Usage

<van-steps :active="active">
  <van-step>Step1</van-step>
  <van-step>Step2</van-step>
  <van-step>Step3</van-step>
  <van-step>Step4</van-step>
</van-steps>
export default {
  data() {
    return {
      active: 1,
    };
  },
};

Custom Style

<van-steps :active="active" active-icon="success" active-color="#38f">
  <van-step>Step1</van-step>
  <van-step>Step2</van-step>
  <van-step>Step3</van-step>
  <van-step>Step4</van-step>
</van-steps>

Vertical Steps

<van-steps direction="vertical" :active="0">
  <van-step>
    <h3>【City】Status1</h3>
    <p>2016-07-12 12:40</p>
  </van-step>
  <van-step>
    <h3>【City】Status2</h3>
    <p>2016-07-11 10:00</p>
  </van-step>
  <van-step>
    <h3>【City】Status3</h3>
    <p>2016-07-10 09:30</p>
  </van-step>
</van-steps>

API

Steps Props

Attribute Description Type Default
active Active step number | string 0
direction Can be set to vertical string horizontal
active-color Active step color string #07c160
inactive-color v2.9.1 Inactive step color string #969799
active-icon Active icon name string checked
inactive-icon Inactive icon name string -

Step Slots

Name Description
active-icon Custom active icon
inactive-icon Custom inactive icon

Steps Events

Event Description Arguments
click-step v2.5.9 Emitted when a step's title or icon is clicked index: number

Less Variables

How to use: Custom Theme.

Name Default Value Description
@step-text-color @gray-6 -
@step-active-color @green -
@step-process-text-color @text-color -
@step-font-size @font-size-md -
@step-line-color @border-color -
@step-finish-line-color @green -
@step-finish-text-color @text-color -
@step-icon-size 12px -
@step-circle-size 5px -
@step-circle-color @gray-6 -
@step-horizontal-title-font-size @font-size-sm -
@steps-background-color @white -