Blame view

ant-design-vue-jeecg/src/views/user/alteration/Alteration.vue 1.52 KB
肖超群 authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<template>
  <a-card :bordered="false" style="width: 130%;text-align: center;margin-left:-10%">
    <a-steps class="steps" :current="currentTab">
      <a-step title="手机验证"/>
      <a-step title="更改密码"/>
      <a-step title="完成"/>
    </a-steps>
    <div class="content">
      <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"/>
    </div>
  </a-card>
</template>

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

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

<style lang="less" scoped>
肖超群 authored
60
61
62
63
64
65
66
67
68
69
70
.steps {
  max-width: 750px;
  margin: 16px auto;
}

/deep/ .password-retrieval-form {
  max-width: 500px;
  margin: 40px auto 0;

  .ant-form-explain {
    text-align: left;
肖超群 authored
71
  }
肖超群 authored
72
}
肖超群 authored
73
74
</style>