1.0.2 • Published 5 years ago

@duoduo-cat/updaycircle v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

ProgressLoop 环形进度条

以环形方式展示进度完成情况

使用方法

安装@upday/updaycircle

npm i @upday/updaycircle

在文件中引入@upday/updaycircle

import updaycircle from '@upday/updaycircle';

基础用法

<updaycircle :percent="30"  lineColor="#3cbd3c" :radius="50" :lineWidth="12" :bgWidth="10"></updaycircle>

显示文案

文案样式可自定义

<updaycircle :percent="50" >
    <span style="font-size:24px">50%</span>
</updaycircle>

渐变颜色

进度动画

<updaycircle :percent="100"  lineColor="#3cbd3c" :radius="50" :lineWidth="12" :bgWidth="10" :duration="1000" @progress="changeText">
    <span style="font-size:24px">{{text}}%</span>
</updaycircle>
<script>
export default {
    data(){
        return{
            text:0
        }
    },
    methods:{
        changeText(rate) {
            this.text = Math.ceil(rate);
        }
    }
}
</script>

Prop

字段说明类型默认值
percent进度条位置百分比(0-100)Number0
lineWidth高亮的进度线宽度(单位px)Number6
lineColor高亮的进度线颜色String#8e71c7
linecap环形路径两端的形状(可选值:butt/round/square)Stringround
radius圆形的半径(单位px)Number100
bgWidth环形线的宽度(单位px)Number6
bgColor环形线的底色String#ddd
gradientStart高亮的进度线渐变颜色初始值String-
gradientEnd高亮的进度线渐变颜色结束值String-
duration进度动画持续时长Number0
1.0.2

5 years ago