WProgress 组件
进度条组件,基于 WinDesignNext Progress 封装,用于展示任务进度、上传进度或加载状态,支持线形、环形、仪表盘三种形态。
基础用法
API
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
component | string | WProgress | 组件类型(必填) |
percentage | number | DataBindingValue | 0 | 进度百分比 (0-100) |
type | string | line | 类型:line / circle / dashboard |
status | string | — | 状态:success / exception / warning |
indeterminate | boolean | false | 不确定进度动画 |
strokeWidth | number | DataBindingValue | 8 | 进度条宽度 |
width | number | DataBindingValue | 126 | 环形/仪表盘尺寸 |
showText | boolean | true | 显示进度文字 |
striped | boolean | false | 条纹效果 |
stripedFlow | boolean | false | 条纹流动 |
title | string | DataBindingValue | — | 标题(dashboard 类型) |
path 支持说明
| 属性 | path 支持 | 说明 |
|---|---|---|
percentage | ✅ | 进度值,Agent 可通过 updateDataModel 动态更新 |
type | ✅ | 进度条形态 |
status | ✅ | 进度状态 |
strokeWidth / width | ✅ | 尺寸配置 |
title | ✅ | 标题文字 |
percentage 动态绑定
json
{
"component": "WProgress",
"percentage": { "path": "/uploadProgress" },
"status": "success"
}Agent 更新进度:
json
{
"version": "v0.9",
"updateDataModel": {
"surfaceId": "main",
"path": "/uploadProgress",
"value": 85
}
}注意事项
percentage取值范围 0-100- 不支持
format、color函数形式,自定义颜色请使用静态color字符串或数组 - 不确定进度场景使用
indeterminate: true