Skip to content

Commit 74f40f1

Browse files
committed
fix: avoid evaluation error in isHTML computed prop
1 parent 9d6e4ee commit 74f40f1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/App.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@
5353
:line-mode="lineMode"
5454
animation="default 1500 1000"
5555
:legend="-123.1"
56-
></ve-progress>
56+
>
57+
<template #legend-caption>
58+
<p>hello</p>
59+
</template>
60+
</ve-progress>
5761
</div>
5862
</div>
5963
</div>

src/components/VueEllipseProgress.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ export default {
6262
return this.data.length > 1;
6363
},
6464
isHTML() {
65-
return /<[a-z/][\s\S]*>/i.test((this.legendFormatter(defaultCounterTick) || "").toString().trim());
65+
return /<[a-z/][\s\S]*>/i.test(
66+
((this.legendFormatter && this.legendFormatter(defaultCounterTick)) || "").toString().trim()
67+
);
6668
},
6769
circlesData() {
6870
if (this.isMultiple) {

0 commit comments

Comments
 (0)