Skip to content

Commit ee378a7

Browse files
committed
fix: loader prop validation
1 parent 9c0347b commit ee378a7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/App.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@
4242
:size="200"
4343
:progress="progress"
4444
:thickness="10"
45+
:loading="loading"
4546
:color-fill="emptyColorFill"
46-
dash="strict 60 0.5"
47+
:loader="{ opacity: '1' }"
4748
:empty-thickness="10"
4849
>
4950
<template v-slot:default="{ counterTick }">

src/components/interface.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { isValidNumber } from "@/utils";
2+
13
const colorConfig = (defaultColor = "transparent") => ({
24
type: [String, Object],
35
required: false,
@@ -14,7 +16,12 @@ const colorConfig = (defaultColor = "transparent") => ({
1416
});
1517

1618
const validateLoaderProps = (loaderOptions) =>
17-
Object.keys(loaderOptions).every((option) => options[option].validator(loaderOptions[option]));
19+
Object.keys(loaderOptions).every((option) => {
20+
if (option === "opacity") {
21+
return isValidNumber(loaderOptions[option] && loaderOptions[option] >= 0);
22+
}
23+
return options[option].validator(loaderOptions[option]);
24+
});
1825

1926
const linePosition = {
2027
type: String,

0 commit comments

Comments
 (0)