UNPKG

3.31 kBTypeScriptView Raw
1import { ComponentType } from 'react'
2import { StandardProps, CommonEventFunction } from './common'
3interface ProgressProps extends StandardProps {
4 /** 百分比 0~100
5 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
6 */
7 percent?: number
8 /** 在进度条右侧显示百分比
9 * @default false
10 * @supported weapp, alipay, swan, qq, jd, h5, rn, harmony_hybrid
11 */
12 showInfo?: boolean
13 /** 圆角大小
14 * @default 0
15 * @supported weapp, swan, qq, jd, h5, harmony_hybrid
16 */
17 borderRadius?: number | string
18 /** 右侧百分比字体大小
19 * @default 16
20 * @supported weapp, swan, qq, jd, h5, harmony_hybrid
21 */
22 fontSize?: number | string
23 /** 进度条线的宽度
24 * @default 6
25 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
26 */
27 strokeWidth?: number | string
28 /** 进度条颜色 (请使用 activeColor)
29 * @default "#09BB07"
30 * @supported weapp, swan, qq, jd, h5, harmony_hybrid
31 */
32 color?: string
33 /** 已选择的进度条的颜色
34 * @default "#09BB07"
35 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
36 */
37 activeColor?: string
38 /** 未选择的进度条的颜色
39 * @default "#EBEBEB"
40 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
41 */
42 backgroundColor?: string
43 /** 进度条从左往右的动画
44 * @default false
45 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
46 */
47 active?: boolean
48 /** backwards: 动画从头播
49 *
50 * forwards: 动画从上次结束点接着播
51 * @default backwards
52 * @supported weapp, swan, tt, qq, jd, h5, rn, harmony_hybrid
53 */
54 activeMode?: 'backwards' | 'forwards'
55 /** 进度增加 1% 所需毫秒数
56 * @default 30
57 * @supported weapp, swan, tt, jd, h5, harmony_hybrid
58 */
59 duration?: number
60 /** 无障碍访问,(属性)元素的额外描述
61 * @supported qq
62 */
63 ariaLabel?: string
64 /** 动画完成事件
65 * @supported weapp, tt, qq, jd, h5, harmony_hybrid
66 */
67 onActiveEnd?: CommonEventFunction
68}
69/** 进度条。组件属性的长度单位默认为 px
70 * @classification base
71 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
72 * @example_react
73 * ```tsx
74 * export default class PageView extends Component {
75 * constructor() {
76 * super(...arguments)
77 * }
78 *
79 * render() {
80 * return (
81 * <View className='components-page'>
82 * <Progress percent={20} showInfo strokeWidth={2} />
83 * <Progress percent={40} strokeWidth={2} active />
84 * <Progress percent={60} strokeWidth={2} active />
85 * <Progress percent={80} strokeWidth={2} active activeColor='blue' />
86 * </View>
87 * )
88 * }
89 * }
90 * ```
91 * @example_vue
92 * ```html
93 * <template>
94 * <view class="components-page">
95 * <progress percent="20" stroke-width="2" :show-info="true" />
96 * <progress percent="40" stroke-width="2" :active="true" />
97 * <progress percent="60" stroke-width="2" :active="true" />
98 * <progress percent="80" stroke-width="2" :active="true" active-color="blue" />
99 * </view>
100 * </template>
101 * ```
102 * @see https://developers.weixin.qq.com/miniprogram/dev/component/progress.html
103 */
104declare const Progress: ComponentType<ProgressProps>
105export { Progress, ProgressProps }