Alteration.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <a-card :bordered="false" style="width: 130%;text-align: center;margin-left:-10%">
  3. <a-steps class="steps" :current="currentTab">
  4. <a-step title="用户账户"/>
  5. <a-step title="手机验证"/>
  6. <a-step title="密码"/>
  7. <a-step title="完成"/>
  8. </a-steps>
  9. <div class="content">
  10. <step1 v-if="currentTab === 0" @nextStep="nextStep"/>
  11. <step2 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep" :userList="userList"/>
  12. <step3 v-if="currentTab === 2" @nextStep="nextStep" @prevStep="prevStep" :userList="userList"/>
  13. <step4 v-if="currentTab === 3" @prevStep="prevStep" @finish="finish" :userList="userList"/>
  14. </div>
  15. </a-card>
  16. </template>
  17. <script>
  18. import Step1 from './Step1'
  19. import Step2 from './Step2'
  20. import Step3 from './Step3'
  21. import Step4 from './Step4'
  22. export default {
  23. name: "Alteration",
  24. components: {
  25. Step1,
  26. Step2,
  27. Step3,
  28. Step4
  29. },
  30. data() {
  31. return {
  32. description: '将一个冗长或用户不熟悉的表单任务分成多个步骤,指导用户完成。',
  33. currentTab: 0,
  34. userList: {},
  35. // form
  36. form: null,
  37. }
  38. },
  39. methods: {
  40. // handler
  41. nextStep(data) {
  42. this.userList = data;
  43. if (this.currentTab < 4) {
  44. this.currentTab += 1
  45. }
  46. },
  47. prevStep(data) {
  48. this.userList = data;
  49. if (this.currentTab > 0) {
  50. this.currentTab -= 1
  51. }
  52. },
  53. finish() {
  54. this.currentTab = 0
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="less" scoped>
  60. .steps {
  61. max-width: 750px;
  62. margin: 16px auto;
  63. }
  64. </style>