Progress
Progress 进度条
代码示例
import { BfProgress } from '@bud-fe/react-taro-ui';import { View } from '@tarojs/components';import React from 'react';import styles from './index.module.less';export default () => {return (<><View className="group-title">基础用法</View><View className={styles['progress-wrapper']}><BfProgress percent={30} /></View><View className="group-title">设置颜色与宽度</View><View className={styles['progress-wrapper']}><BfProgress percent={70} background="gray" color="cyan" strokeWidth={20} /></View><View className="group-title">显示百分比</View><View className={styles['progress-wrapper']}><BfProgress percent={50} showText /></View><View className="group-title">动画效果</View><View className={styles['progress-wrapper']}><BfProgress percent={60} animated /></View></>);};
API
属性名 | 描述 | 类型 | 默认值 |
---|---|---|---|
percent | 百分比 | number | 0 |
background | 进度条背景颜色 | string | #f2f3f5 |
color | 进度条线条颜色 | string | #fd3c42 |
strokeWidth | 进度条宽度 | string | number | 12px |
showText | 是否显示文字内容 | boolean | false |
animated | 是否展示动画效果 | boolean | false |
delay | 延迟数据加载时长,单位 ms | number | 0 |