uniapp-【progress】

属性名类型默认值说明平台差异说明
percentFloat百分比0~100 
show-infoBooleanfalse在进度条右侧显示百分比 
border-radiusnumber/string0圆角大小app-nvue、微信基础库2.3.1+、QQ小程序
font-sizenumber/string16右侧百分比字体大小app-nvue、微信基础库2.3.1+、QQ小程序
stroke-widthNumber6进度条线的宽度,单位px 
activeColorColor#09BB07(百度为#E6E6E6)已选择的进度条的颜色 
backgroundColorColor#EBEBEB未选择的进度条的颜色 
activeBooleanfalse进度条从左往右的动画 
active-modeStringbackwardsbackwards: 动画从头播;forwards:动画从上次结束点接着播App、H5、微信小程序、QQ小程序
durationnumber30进度增加1%所需毫秒数App-nvue2.6.1+、微信基础库2.8.2+
@activeendEventHandle 动画完成事件微信小程序

 

 

<view class="uni-padding-wrap uni-common-mt">
            <view class="progress-box">
                <progress :percent="pgList[0]" show-info stroke-width="3" />
            </view>
            <view class="progress-box">
                <progress :percent="pgList[1]" stroke-width="3" />
                <uni-icons type="close" class="progress-cancel" color="#dd524d"></uni-icons>
            </view>
            <view class="progress-box">
                <progress :percent="pgList[2]" stroke-width="3" />
            </view>
            <view class="progress-box">
                <progress :percent="pgList[3]" activeColor="#10AEFF" stroke-width="3" />
            </view>
            <view class="progress-control">
                <button type="primary" @click="setProgress">设置进度</button>
                <button type="warn" @click="clearProgress">清除进度</button>
            </view>
</view>

export default {
        data() {
            return {
                pgList: [0, 0, 0, 0]
            }
        },
        components: {
            uniIcons
        },
        methods: {
            setProgress() {
                this.pgList = [20, 40, 60, 80]
            },
            clearProgress() {
                this.pgList = [0, 0, 0, 0]
            }
        }
    }

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值