664d88ebadf893bd5c13c11eeece749293fa7680.svn-base 1.3 KB

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