Skip to content

Commit 0c31a0a

Browse files
iamkunisland205
authored andcommitted
Progress: add strokeLinecap prop (#17552)
* Progress: add strokeLinecap prop * update docs
1 parent 42e74d1 commit 0c31a0a

File tree

6 files changed

+12
-1
lines changed

6 files changed

+12
-1
lines changed

examples/docs/en-US/progress.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,4 @@ You also can specify `type` attribute to `dashboard` to use dashboard progress b
170170
| color | background color of progress bar. Overrides `status` prop | string/function/array || '' |
171171
| width | the canvas width of circle progress bar | number || 126 |
172172
| show-text | whether to show percentage | boolean || true |
173+
| stroke-linecap | circle/dashboard type shape at the end path | string | butt/round/square | round |

examples/docs/es/progress.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,4 @@ Puede utilizar el atributo `color` para establecer el color de la barra de progr
168168
| color | color de fondo de la barra de progreso. Sobreescribe la propiedad `status` | string/function/array || '' |
169169
| width | ancho del canvas que contiene la barra de progreso circula | number || 126 |
170170
| show-text | mostrar porcentaje | boolean || true |
171+
| stroke-linecap | circle/dashboard type shape at the end path | string | butt/round/square | round |

examples/docs/fr-FR/progress.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,4 @@ Vous pouvez également spécifier l'attribut `type` de `dashboard` pour utiliser
171171
| color | La couleur de fon de la barre. Écrase `status`. | string/function/array || '' |
172172
| width | La largeur du canvas dans le cas d'une barre circulaire. | number || 126 |
173173
| show-text | Si le pourcentage doit être affiché. | boolean || true |
174+
| stroke-linecap | circle/dashboard type shape at the end path | string | butt/round/square | round |

examples/docs/zh-CN/progress.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,4 @@ Progress 组件可通过 `type` 属性来指定使用环形进度条,在环形
174174
| color | 进度条背景色(会覆盖 status 状态颜色) | string/function/array || '' |
175175
| width | 环形进度条画布宽度(只在 type 为 circle 或 dashboard 时可用) | number | | 126 |
176176
| show-text | 是否显示进度条文字内容 | boolean || true |
177+
| stroke-linecap | circle/dashboard 类型路径两端的形状 | string | butt/round/square | round |

packages/progress/src/progress.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
:d="trackPath"
3636
:stroke="stroke"
3737
fill="none"
38-
stroke-linecap="round"
38+
:stroke-linecap="strokeLinecap"
3939
:stroke-width="percentage ? relativeStrokeWidth : 0"
4040
:style="circlePathStyle"></path>
4141
</svg>
@@ -73,6 +73,10 @@
7373
type: Number,
7474
default: 6
7575
},
76+
strokeLinecap: {
77+
type: String,
78+
default: 'round'
79+
},
7680
textInside: {
7781
type: Boolean,
7882
default: false

types/progress.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ export declare class ElProgress extends ElementUIComponent {
1414
/** The width of progress bar */
1515
strokeWidth: number
1616

17+
/** Circle progress bar stroke line cap */
18+
strokeLinecap: string
19+
1720
/** Whether to place the percentage inside progress bar, only works when type is 'line' */
1821
textInside: boolean
1922

0 commit comments

Comments
 (0)