2018-04-03 14:14:38 +08:00
|
|
|
## API
|
|
|
|
|
2019-04-30 13:31:21 +08:00
|
|
|
Properties that shared by all types.
|
|
|
|
|
2018-04-03 14:14:38 +08:00
|
|
|
| Property | Description | Type | Default |
|
2019-09-28 20:45:07 +08:00
|
|
|
| --- | --- | --- | --- |
|
2019-04-30 13:31:21 +08:00
|
|
|
| type | to set the type, options: `line` `circle` `dashboard` | string | `line` |
|
2018-09-05 21:28:54 +08:00
|
|
|
| format | template function of the content | function(percent, successPercent) | `percent => percent + '%'` |
|
2018-04-03 14:14:38 +08:00
|
|
|
| percent | to set the completion percentage | number | 0 |
|
|
|
|
| showInfo | whether to display the progress value and the status icon | boolean | true |
|
2019-04-30 13:31:21 +08:00
|
|
|
| status | to set the status of the Progress, options: `success` `exception` `active` `normal` | string | - |
|
2018-09-05 21:28:54 +08:00
|
|
|
| strokeLinecap | to set the style of the progress linecap | Enum{ 'round', 'square' } | `round` |
|
|
|
|
| strokeColor | color of progress bar | string | - |
|
2019-04-30 13:31:21 +08:00
|
|
|
| successPercent | segmented success percent | number | 0 |
|
|
|
|
|
|
|
|
### `type="line"`
|
|
|
|
|
2019-09-28 20:45:07 +08:00
|
|
|
| Property | Description | Type | Default |
|
|
|
|
| ----------- | ------------------------------------------------ | ------ | ------- |
|
|
|
|
| strokeWidth | to set the width of the progress bar, unit: `px` | number | 10 |
|
2019-04-30 13:31:21 +08:00
|
|
|
|
|
|
|
### `type="circle"`
|
|
|
|
|
|
|
|
| Property | Description | Type | Default |
|
2019-09-28 20:45:07 +08:00
|
|
|
| --- | --- | --- | --- |
|
2019-04-30 13:31:21 +08:00
|
|
|
| width | to set the canvas width of the circular progress, unit: `px` | number | 132 |
|
|
|
|
| strokeWidth | to set the width of the circular progress, unit: percentage of the canvas width | number | 6 |
|
|
|
|
|
|
|
|
### `type="dashboard"`
|
|
|
|
|
|
|
|
| Property | Description | Type | Default |
|
2019-09-28 20:45:07 +08:00
|
|
|
| --- | --- | --- | --- |
|
2019-04-30 13:31:21 +08:00
|
|
|
| width | to set the canvas width of the dashboard progress, unit: `px` | number | 132 |
|
|
|
|
| strokeWidth | to set the width of the dashboard progress, unit: percentage of the canvas width | number | 6 |
|
|
|
|
| gapDegree | the gap degree of half circle, 0 ~ 360 | number | 0 |
|
|
|
|
| gapPosition | the gap position, options: `top` `bottom` `left` `right` | string | `top` |
|