Skip to content

vProgress 进度条

进度条组件,支持线性和环形两种模式。

基础用法

vue
<script setup>
import { vProgress } from '@twi1i9ht/visual-lib'
</script>

<template>
  <vProgress :percentage="70" />
</template>

自定义颜色

vue
<template>
  <vProgress :percentage="80" color="#67c23a" />
  <vProgress :percentage="50" color="#e6a23c" />
  <vProgress :percentage="30" color="#f56c6c" />
</template>

环形进度

vue
<template>
  <vProgress :percentage="75" type="circle" :width="120" />
</template>

Props

属性类型默认值说明
percentagenumber0百分比 (0-100)
type'line' | 'circle''line'类型
colorstring'#409eff'进度条颜色
backgroundColorstring'#e9ecef'背景色
strokeWidthnumber6线条宽度
widthnumber120环形进度的直径
showTextbooleantrue是否显示文字
format(percentage: number) => string自定义文字格式

Released under the MIT License.