From d1d8ab3c647d50f37832d1ae531550944d5aa8e3 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Fri, 5 May 2023 14:35:23 +0200 Subject: [PATCH] fix(Button): `variant` validator takes color into account --- src/runtime/components/elements/Button.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/runtime/components/elements/Button.vue b/src/runtime/components/elements/Button.vue index d916019a..6f289c5e 100644 --- a/src/runtime/components/elements/Button.vue +++ b/src/runtime/components/elements/Button.vue @@ -78,7 +78,10 @@ export default defineComponent({ type: String, default: () => appConfig.ui.button.default.variant, validator (value: string) { - return Object.keys(appConfig.ui.button.variant).includes(value) + return [ + ...Object.keys(appConfig.ui.button.variant), + ...Object.values(appConfig.ui.button.color).flatMap(value => Object.keys(value)) + ].includes(value) } }, icon: {