Skip to content

Commit

Permalink
feat(VBtn): add support for active-color prop
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed May 13, 2024
1 parent 9dbc30a commit aee83f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vuetify/src/components/VBtn/VBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const makeVBtnProps = propsFactory({
type: Boolean,
default: undefined,
},
activeColor: String,
baseColor: String,
symbol: {
type: null,
Expand Down Expand Up @@ -123,13 +124,14 @@ export const VBtn = genericComponent<VBtnSlots>()({
return group?.isSelected.value
})

const color = computed(() => isActive.value ? props.activeColor ?? props.color : props.color)
const variantProps = computed(() => {
const showColor = (
(group?.isSelected.value && (!link.isLink.value || link.isActive?.value)) ||
(!group || link.isActive?.value)
)
return ({
color: showColor ? props.color ?? props.baseColor : props.baseColor,
color: showColor ? color.value ?? props.baseColor : props.baseColor,
variant: props.variant,
})
})
Expand Down

0 comments on commit aee83f0

Please sign in to comment.