Skip to content

Commit

Permalink
fix(Button): variant validator takes color into account
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed May 5, 2023
1 parent 5b8ab16 commit d1d8ab3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtime/components/elements/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit d1d8ab3

Please sign in to comment.