Skip to content

t-progress-line

ProgressLine 线形进度

组件介绍

线型进度条组件可以直观地展示进度百分比,适用于多种场景,如加载指示器、任务完成度展示等。

平台兼容

HarmonyH5AndroidiOS小程序UTS

基础用法

vue
<template>
  <view class="progress-demo">
    <t-progress-line :percent="30"></t-progress-line>
    <t-progress-line :percent="60" :showPercentage="true"></t-progress-line>
    <t-progress-line :percent="90" type="primary" :showPercentage="true"></t-progress-line>
    <t-progress-line :percent="75" activeColor="#ff6b6b" :showPercentage="true"></t-progress-line>
  </view>
</template>

<style scoped>
.progress-demo {
  padding: 40rpx;
  display: flex;
  flex-direction: column;
  gap: 30rpx;
}
</style>

Props

属性名类型默认值说明可选值
sizeString"medium"组件尺寸large, medium, small, mini
typeString""组件类型info, primary, error, warning, success
disabledBooleanfalse组件是否禁用true, false
hoverBooleanfalse是否有点击效果true, false
pathString""点击组件后跳转的页面路径-
effectString"normal"组件显示主题normal, dark, light, plain
percentNumber0进度条的当前百分比0-100
showPercentageBooleanfalse是否显示进度百分比true, false
activeColorString""进度条激活时的颜色-

Events

事件名说明回调参数
click点击时触发-
transitionend动画结束时触发-
initFinished组件初始化完成触发组件的节点信息
touchstart触摸开始时触发触摸事件对象
touchend触摸结束时触发触摸事件对象
touchmove触摸移动时触发触摸事件对象
touchcancel触摸取消时触发触摸事件对象