小程序开放平台

文档中心
表单组件
基础内容
icon
progress
rich-text
text
媒体组件
地图
视图容器
开放能力
画布

progress

开发
>
组件
>
基础内容
>
progress
>
更新时间:2024-11-13 20:32:03

progress

进度条。组件属性的长度单位默认为px

属性
类型
默认值
必填
说明
percentnumber百分比0~100
show-infobooleanfalse在进度条右侧显示百分比
border-radiusnumber,string0圆角大小
font-sizenumber,string16右侧百分比字体大小
stroke-widthnumber,string6进度条线的宽度
colorstring#09BB07进度条颜色(请使用activeColor)
active-colorstring#09BB07已选择的进度条的颜色
background-colorstring#EBEBEB未选择的进度条的颜色
activebooleanfalse进度条从左往右的动画
active-modestringbackwardsbackwards: 动画从头播;forwards:动画从上次结束点接着播
durationnumber30进度增加1%所需毫秒数
bindactiveendeventhandle动画完成事件

扫码预览

组件示例

    <view class="page-section page-section-gap">
      <view class="progress-box">
        <progress percent="20" show-info stroke-width="3"/>
      </view>

      <view class="progress-box">
        <progress percent="40" active stroke-width="3" />
        <icon class="progress-cancel" type="cancel"></icon>
      </view>

      <view class="progress-box">
        <progress percent="60" active stroke-width="3" />
      </view>

      <view class="progress-box">
        <progress percent="80" color="#10AEFF" active stroke-width="3" />
      </view>
    </view>

该文档是否对您有帮助?