步骤条

例子

步骤条 - 图1

  1. <avue-steps :option="option" @change="change" @submit="submit">
  2. <template slot="before">
  3. <el-tag>卡槽头部{{type}}</el-tag>
  4. </template>
  5. <template slot="info">
  6. <avue-form :option="item.option" v-model="form"></avue-form>
  7. </template>
  8. <template slot="pwd">
  9. <avue-form :option="item.option" v-model="form"></avue-form>
  10. </template>
  11. <template slot="finsh">
  12. <avue-crud :option="item.option" :data="list"></avue-crud>
  13. </template>
  14. <template slot="after">
  15. <el-tag>卡槽尾部{{type}}</el-tag>
  16. </template>
  17. <template slot="menu">
  18. <el-button type="primary">自定义按钮</el-button>
  19. </template>
  20. </avue-steps>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. type:'',
  26. form:'',
  27. item:'',
  28. list: [
  29. {
  30. money:'12.00',
  31. date:'2018-06-06',
  32. }, {
  33. money:'233.00',
  34. date:'2018-06-06',
  35. }, {
  36. money:'2.00',
  37. date:'2018-06-06',
  38. }, {
  39. money:'3.00',
  40. date:'2018-06-06',
  41. }
  42. ],
  43. option:{
  44. switchBtn:true,
  45. column: [{
  46. label: '填写转账信息',
  47. prop: 'info',
  48. description: '用于信息的转账',
  49. option: {
  50. formWidth:'40%',
  51. column: [
  52. {
  53. label: "转账金额",
  54. span: 24,
  55. prop: "money",
  56. size: 'small',
  57. prefixIcon: 'el-icon-tickets',
  58. rules: [{
  59. required: true,
  60. message: "请输入转账金额",
  61. trigger: "blur"
  62. }]
  63. }
  64. ]
  65. }
  66. }, {
  67. label: '确认转账信息',
  68. prop: 'pwd',
  69. description: '为了安全再次确认转账',
  70. option: {
  71. formWidth:'40%',
  72. emptyBtn:false,
  73. column: [{
  74. label: "支付密码",
  75. prop: "password",
  76. type: 'password',
  77. size: 'small',
  78. span: 24,
  79. rules: [{
  80. required: true,
  81. message: "请输入支付密码",
  82. trigger: "blur"
  83. }],
  84. }]
  85. }
  86. }, {
  87. label: '完成',
  88. prop: 'finsh',
  89. description: '转账信息完成',
  90. // icon: 'el-icon-picture-outline',
  91. option: {
  92. page:false,
  93. index:true,
  94. title:'交易记录',
  95. column: [
  96. {
  97. label:'金额',
  98. prop:'money'
  99. }, {
  100. label:'时间',
  101. prop:'date'
  102. }
  103. ]
  104. }
  105. }]
  106. }
  107. }
  108. },
  109. methods:{
  110. submit (next) {
  111. next();
  112. },
  113. change (item) {
  114. this.type = item.prop;
  115. this.item = item;
  116. this.$message.success('当前步骤数据'+JSON.stringify(item));
  117. },
  118. }
  119. }
  120. </script>

Avue-steps Option Attributes

参数说明类型可选值默认值
label步骤条显示名称String--
prop步骤条别名String--
description步骤条描述String--
icon步骤条图标String--
switchBtn步骤条是否可以点击Booleantrue / falsefalse
simple步骤条是否为简约模式Booleantrue / falsefalse

Avue-steps Events

事件名说明参数
change返回当前步骤的整体对象item
submit点击下一步或提交的回调(当为最后一个步骤时,无next返回)next

Avue-steps Scoped Slot

name说明
after内容之前的卡槽
brfore内容之后的卡槽
说明每个选项卡的卡槽