Files
cmgd-mini-app/uni_modules/nutui-uni/components/progress/progress.ts
2026-01-05 12:47:14 +08:00

54 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { ExtractPropTypes } from 'vue'
import { commonProps, makeNumericProp, makeStringProp, truthProp } from '../_utils'
export const progressProps = {
...commonProps,
/**
* @description 百分比
*/
percentage: {
type: [Number, String],
default: 0,
required: true,
},
/**
* 是否需要展示百分号
*
* @description 是否需要展示百分号
*/
isShowPercentage: truthProp,
/**
* @description 进度条背景色
*/
strokeColor: makeStringProp(''),
/**
* @description 进度条宽度
*/
strokeWidth: makeNumericProp(''),
/**
* @description 进度条及文字尺寸,可选值 `small` `base` `large`
*/
size: makeStringProp<'small' | 'base' | 'large'>('base'),
/**
* @description 是否显示进度条文字内容
*/
showText: truthProp,
/**
* @description 进度条文字显示位置(false:外显true:内显)
*/
textInside: Boolean,
/**
* @description 进度条文字颜色设置
*/
textColor: makeStringProp(''),
/**
* @description 进度条文字背景颜色设置
*/
textBackground: makeStringProp(''),
/**
* @description 进度条当前状态,可选值`active(展示动画效果)` `icon(展示icon标签)`
*/
status: makeStringProp<'text' | 'active' | 'icon'>('text'),
}
export type ProgressProps = ExtractPropTypes<typeof progressProps>