Skip to content

Commit

Permalink
feat(VSnackbar): pass internal isActive model through activator slot
Browse files Browse the repository at this point in the history
this is in line with how VOverlay does it
  • Loading branch information
johnleider committed Feb 14, 2024
1 parent 5f31492 commit 92560a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/vuetify/src/components/VSnackbar/VSnackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ import { genOverlays, makeVariantProps, useVariant } from '@/composables/variant
import { mergeProps, nextTick, onMounted, onScopeDispose, ref, shallowRef, watch } from 'vue'
import { genericComponent, omit, propsFactory, refElement, useRender } from '@/util'

// Types
import type { Ref } from 'vue'

type VSnackbarSlots = {
activator: { isActive: boolean, props: Record<string, any> }
default: never
actions: never
actions: { isActive: Ref<boolean> }
text: never
}

Expand Down Expand Up @@ -227,7 +230,7 @@ export const VSnackbar = genericComponent<VSnackbarSlots>()({
}}
>
<div class="v-snackbar__actions">
{ slots.actions() }
{ slots.actions({ isActive }) }
</div>
</VDefaultsProvider>
)}
Expand Down

0 comments on commit 92560a6

Please sign in to comment.