Skip to content

Circle 环形进度条

圆环形的进度条组件,支持进度渐变动画。

基础用法

通过v-model表示进度条的当前进度,text属性控制进度条中间文字内容。

html
<wui-circle v-model="current" :text="`进度:${current}%`"></wui-circle>
ts
const current = ref<number>(10)

宽度控制

通过strokeWidth属性来控制进度条宽度,默认10px

html
<wui-circle v-model="current" :strokeWidth="15"></wui-circle>

颜色定制

通过color属性控制进度条颜色,默认#1C64FD,通过layerColor属性控制进度条轨道颜色,默认#EBEEF5

html
<wui-circle v-model="current" color="#1C64FD" layer-color="#EBEEF5"></wui-circle>

渐变色

color属性支持传入对象格式来定义渐变色。

html
<wui-circle v-model="current" :color="gradientColor"></wui-circle>
ts
const gradientColor = {
  '0%': '#ffd01e',
  '100%': '#ee0a24'
}

进度条展开方向

通过clockwise属性控制进度条展开方向,clockwisefalse时,进度会从逆时针方向开始。

html
<wui-circle v-model="current" :clockwise="false"></wui-circle>

大小定制

通过size属性控制进度条圆环直径,默认100px

html
<wui-circle v-model="current" :size="300"></wui-circle>

Attributes

参数说明类型可选值默认值最低版本
v-model |modelValue当前进度number-0-
customClass自定义 classstring---
customStyle自定义 stylestring---
size圆环直径,默认单位为 pxnumber-100-
color进度条颜色string / Record<string, string>-#4d80f0-
layerColor轨道颜色string-#EBEEF5-
fill填充颜色string-#ffffff-
speed动画速度(单位为 rate/s)number-50-
text文字string---
strokeWidth进度条宽度,单位 pxnumber-10-
strokeLinecap进度条端点的形状stringbutt / round / squareround-
clockwise是否顺时针增加boolean-true-

Circle 外部样式类

类名说明最低版本
custom-class根节点样式-

源代码

文档
组件

Released under the MIT License.

Released under the MIT License.