Skip to content

Commit b3e8d60

Browse files
committed
fix: fix gradients handling in half circle
1 parent d24e724 commit b3e8d60

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

src/App.vue

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,17 @@
4545
:thickness="10"
4646
:empty-thickness="10"
4747
line-mode="out"
48-
:color="emptyColorFill"
49-
:loader="{ lineMode: 'in ', opacity: 1 }"
48+
:color="gradient"
49+
:loader="{
50+
lineMode: 'in ',
51+
opacity: 1,
52+
color: {
53+
colors: [
54+
{ color: 'yellow', offset: '0' },
55+
{ color: 'red', offset: '100' },
56+
],
57+
},
58+
}"
5059
>
5160
</ve-progress>
5261
</div>
@@ -59,7 +68,6 @@
5968
half
6069
:no-data="noData"
6170
:determinate="determinate"
62-
:loader="{ thickness: 40, color: 'red' }"
6371
>
6472
<template #legend>
6573
<span>/ hey</span>
@@ -139,6 +147,21 @@ export default {
139147
],
140148
radial: true,
141149
},
150+
gradient: {
151+
colors: [
152+
{
153+
color: "red",
154+
offset: "0",
155+
opacity: "1",
156+
},
157+
{
158+
color: "blue",
159+
offset: "100",
160+
opacity: "1",
161+
},
162+
],
163+
radial: false,
164+
},
142165
animation: "rs 1000 500",
143166
}),
144167
computed: {

src/components/Circle/CircleLoader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default {
3939
},
4040
loaderColor() {
4141
return Array.isArray(this.options.loader.color.colors)
42-
? `url(#ep-loader-gradient-${this.options.id})`
42+
? `url(#ep-loader-gradient-${this.options.uid})`
4343
: this.options.color;
4444
},
4545
},

src/components/Circle/HalfCircleLoader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default {
4040
},
4141
halfLoaderColor() {
4242
return Array.isArray(this.options.loader.color.colors)
43-
? `url(#ep-loader-gradient-${this.options.id})`
43+
? `url(#ep-loader-gradient-${this.options.uid})`
4444
: this.options.color;
4545
},
4646
},

0 commit comments

Comments
 (0)