进度条 Progress

基本

  1. <div class="progress" style="padding:20px 0;">
  2. <za-progress :percent="percent" :theme="theme" :shape="shape" :weight="weight">
  3. 10%
  4. </za-progress>
  5. </div>
  6. <div class="progress">
  7. <za-progress type="circle" :percent="percent" :theme="theme" :shape="shape" :weight="weight">
  8. <div class="progress-content">
  9. <span class="progress-text">10</span><span class="progress-percent">%</span>
  10. </div>
  11. </za-progress>
  12. </div>
  13. <div class="progress">
  14. <za-progress type="semi-circle" :percent="percent" :theme="theme" :shape="shape" :weight="weight">
  15. <div class="progress-content">
  16. <span class="progress-text">10</span><span class="progress-percent">%</span>
  17. </div>
  18. </za-progress>
  19. </div>
  20. <za-cell title="进度">
  21. <za-stepper shape="radius" :step="10" :min="0" :max="100" v-model="percent" @step-change="handleStepChange">
  22. </za-stepper></za-cell>
  23. <za-cell title="主题">
  24. <za-select :defaultValue="theme" :data-source="dataSource" @ok="handleOk">
  25. </za-select></za-cell>
  26. <za-cell title="线条形状">
  27. <za-select :defaultValue="shape" :data-source="shapeSource" @ok="handleShape">
  28. </za-select></za-cell>
  29. <za-cell title="线条粗细">
  30. <za-select :defaultValue="weight" :data-source="weightSource" @ok="handleWeight">
  31. </za-select></za-cell>

Vue Script

<script name="vue">
export default {
  data() {
    return {
      percent: 10,
      theme: 'primary',
      shape: 'round',
      weight: 'normal',
      dataSource:[
        { value: 'primary', label: 'primary' },
        { value: 'success', label: 'success' },
        { value: 'warning', label: 'warning' },
        { value: 'error', label: 'error' },
      ],
      shapeSource:[
        { value: 'rect', label: 'rect' },
        { value: 'round', label: 'round' },
      ],
      weightSource:[
        { value: 'normal', label: 'normal' },
        { value: 'thin', label: 'thin' },
      ],
    }
  },
  methods: {
    handleStepChange(e) {

    },
    handleOk(v) {
      this.theme = v.value;
    },
    handleShape(v) {
      this.shape = v.value;
    },
    handleWeight(v) {
      this.weight = v.value;
    },

  },
};
</script>

API

属性类型默认值可选值/参数说明
themestring'primary''primary', 'success', 'warning', 'error'主题
percentnumber0进度百分比(范围:0 ~ 100)
shapestring'rect''rect', 'round'线条形状
weightstring , number'normal''normal', 'thin'线条粗细
typestring'line''line', 'circle' , 'semi-circle'类型

Progress 进度条 - 图1