Alteration.vue 1.5 KB
Newer Older
1
<template>
2
  <a-card :bordered="false" style="width: 130%;text-align: center;margin-left:-10%">
3
    <a-steps class="steps" :current="currentTab">
4 5 6
      <a-step title="手机验证"/>
      <a-step title="密码"/>
      <a-step title="完成"/>
7 8
    </a-steps>
    <div class="content">
9 10 11
      <step2 v-if="currentTab === 0" @nextStep="nextStep"/>
      <step3 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep" :userList="userList"/>
      <step4 v-if="currentTab === 2" @prevStep="prevStep" @finish="finish" :userList="userList"/>
12 13 14 15 16 17 18 19
    </div>
  </a-card>
</template>

<script>
  import Step1 from './Step1'
  import Step2 from './Step2'
  import Step3 from './Step3'
20
  import Step4 from './Step4'
21

22
  export default {
23
    name: "Alteration",
24 25 26
    components: {
      Step1,
      Step2,
27 28
      Step3,
      Step4
29
    },
30
    data() {
31 32 33
      return {
        description: '将一个冗长或用户不熟悉的表单任务分成多个步骤,指导用户完成。',
        currentTab: 0,
34
        userList: {},
35 36 37 38 39 40 41
        // form
        form: null,
      }
    },
    methods: {

      // handler
42 43
      nextStep(data) {
        this.userList = data;
44
        if (this.currentTab < 4) {
45 46 47
          this.currentTab += 1
        }
      },
48 49
      prevStep(data) {
        this.userList = data;
50 51 52 53
        if (this.currentTab > 0) {
          this.currentTab -= 1
        }
      },
54
      finish() {
55 56 57 58 59 60
        this.currentTab = 0
      }
    }
  }
</script>

61
<style lang="less" scoped>
62 63 64 65 66
  .steps {
    max-width: 750px;
    margin: 16px auto;
  }
</style>