demo.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <div>
  3. <h4>正常流程</h4>
  4. <nut-steps :current="current">
  5. <nut-step title="已完成" content></nut-step>
  6. <nut-step title content="这里是该步骤的描述信息"></nut-step>
  7. <nut-step title="进行中" content="这里是该步骤的描述信息"></nut-step>
  8. <nut-step title="待进行" content="这里是该步骤的描述信息"></nut-step>
  9. <nut-step title="待进行" content="这里是该步骤的描述信息"></nut-step>
  10. </nut-steps>
  11. <h4>流程终止</h4>
  12. <nut-steps :current="current" status="error">
  13. <nut-step title="已完成" content="这里是该步骤的描述信息"></nut-step>
  14. <nut-step title="已完成" content="这里是该步骤的描述信息"></nut-step>
  15. <nut-step title="进行中" content="这里是该步骤的描述信息"></nut-step>
  16. <nut-step title="待进行" content="这里是该步骤的描述信息"></nut-step>
  17. <nut-step title="待进行" content="这里是该步骤的描述信息"></nut-step>
  18. </nut-steps>
  19. <h4>动态加载(2s后渲染)</h4>
  20. <nut-steps :current="current2" :source="titles">
  21. <nut-step :key="index" v-for="(item, index) in titles" :title="item" content="这里是该步骤的描述信息"></nut-step>
  22. </nut-steps>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. components: {},
  28. data() {
  29. return {
  30. current: 3,
  31. titles: [],
  32. current2: 0
  33. };
  34. },
  35. mounted() {
  36. setTimeout(() => {
  37. this.titles = ['已完成', '已完成', '进行中'];
  38. this.current2 = 3;
  39. }, 2000);
  40. },
  41. methods: {
  42. next() {
  43. this.current = this.current + 1;
  44. }
  45. }
  46. };
  47. </script>
  48. <style lang="scss" scoped>
  49. .nut-steps {
  50. margin-left: 10px;
  51. }
  52. .next-step {
  53. text-align: center;
  54. line-height: 30px;
  55. color: #ffffff;
  56. background: #2d8cf0;
  57. border-radius: 3px;
  58. }
  59. </style>