Alteration.vue 1.6 KB
Newer Older
1 2 3
<template>
  <a-card :bordered="false">
    <a-steps class="steps" :current="currentTab">
4 5 6
      <a-step title="账户信息" />
      <a-step title="身份验证" />
      <a-step title="更改密码" />
7 8 9
      <a-step title="完成" />
    </a-steps>
    <div class="content">
10 11 12 13
      <step1 v-if="currentTab === 0" @nextStep="nextStep"  />
      <step2 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep" :userList="userList"/>
      <step3 v-if="currentTab === 2" @nextStep="nextStep" @prevStep="prevStep" :userList="userList"/>
      <step4 v-if="currentTab === 3" @prevStep="prevStep" @finish="finish" :userList="userList"/>
14 15 16 17 18 19 20 21
    </div>
  </a-card>
</template>

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

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

<style lang="scss" scoped>
  .steps {
    max-width: 750px;
    margin: 16px auto;
  }
</style>