Skip to content

Commit 7435fa0

Browse files
validators
1 parent d2d745c commit 7435fa0

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/components/VueContentLoading.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export default {
1010
type: {
1111
default: 'facebook',
1212
type: String,
13+
validator (type) {
14+
return true; // validate
15+
},
1316
},
1417
speed: {
1518
default: 2,
@@ -26,11 +29,17 @@ export default {
2629
custom: Object,
2730
primary: {
2831
type: String,
29-
default: '#f00',
32+
default: '#f0f0f0',
33+
validator (color) {
34+
return /^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})$/.test(color);
35+
},
3036
},
3137
secondary: {
3238
type: String,
33-
default: '#0f0',
39+
default: '#e0e0e0',
40+
validator (color) {
41+
return /^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})$/.test(color);
42+
},
3443
},
3544
},
3645

@@ -76,4 +85,4 @@ export default {
7685
export {
7786
Rect,
7887
Circle,
79-
};
88+
};

0 commit comments

Comments
 (0)