Progress 进度条

展示操作的当前进度。

何时使用

在操作需要较长时间才能完成时,为用户显示该操作的当前进度和状态。

  • 当一个操作会打断当前界面,或者需要在后台运行,且耗时可能超过2秒时;
  • 当需要显示一个操作完成的百分比时。

    代码演示


30%
50%

进度条

标准的进度条。

expand code expand code

75%

进度圈

圈形的进度。

expand code expand code

30%
50%

小型进度条

适合放在较狭窄的区域内。

expand code expand code

30%

小型进度圈

小一号的圈形进度。

expand code expand code

0%

进度圈动态展示

会动的进度条才是好进度条。

expand code expand code

75 Days
Done

自定义文字格式

format 属性指定格式。

expand code expand code

0%

动态展示

会动的进度条才是好进度条。

expand code expand code

75%

仪表盘

By setting type=dashboard, you can get a dashboard style of progress easily.

expand code expand code

60%

分段进度条

标准的进度条。

expand code expand code

75%
75%
75%

圆角/方角边缘

strokeLinecap="square|round" 可以调整进度条边缘的形状。

expand code expand code

API

属性 说明 类型 默认值
format 内容的模板函数 function(percent, successPercent) percent => percent + '%'
gapDegree (type=circle) 圆形进度条缺口角度,可取值 0 ~ 360 number 0
gapPosition (type=circle) 圆形进度条缺口位置 Enum{ 'top', 'bottom', 'left', 'right' } top
percent 百分比 number 0
showInfo 是否显示进度数值或状态图标 boolean true
status 状态,可选:normal success exception active string normal
strokeWidth (type=line) 进度条线的宽度,单位 px number 10
strokeWidth (type=circle) 圆形进度条线的宽度,单位是进度条画布宽度的百分比 number 6
strokeLinecap Enum{ 'round', 'square' } round
strokeColor 进度条的色彩 string -
successPercent 已完成的分段百分比,type="line" 时有效 number 0
type 类型,可选 line circle dashboard string line
width (type=circle) 圆形进度条画布宽度,单位 px number 120
  Popconfirm 气泡确认框Skeleton 骨架屏