Skip to content

Commit 07a6fb8

Browse files
authored
fix(VFab): change type for location prop (#19949)
fixes #19944
1 parent e11d38d commit 07a6fb8

File tree

1 file changed

+5
-9
lines changed
  • packages/vuetify/src/components/VFab

1 file changed

+5
-9
lines changed

packages/vuetify/src/components/VFab/VFab.tsx

+5-9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { makeVBtnProps, VBtn } from '@/components/VBtn/VBtn'
66

77
// Composables
88
import { makeLayoutItemProps, useLayoutItem } from '@/composables/layout'
9+
import { makeLocationProps } from '@/composables/location'
910
import { useProxiedModel } from '@/composables/proxiedModel'
1011
import { useResizeObserver } from '@/composables/resizeObserver'
1112
import { useToggleScope } from '@/composables/toggleScope'
@@ -16,20 +17,14 @@ import { computed, ref, shallowRef, toRef, watchEffect } from 'vue'
1617
import { genericComponent, omit, propsFactory, useRender } from '@/util'
1718

1819
// Types
19-
import type { ComputedRef, PropType } from 'vue'
20+
import type { ComputedRef } from 'vue'
2021
import type { Position } from '@/composables/layout'
2122

22-
const locations = ['start', 'end', 'left', 'right', 'top', 'bottom'] as const
23-
2423
export const makeVFabProps = propsFactory({
2524
app: Boolean,
2625
appear: Boolean,
2726
extended: Boolean,
2827
layout: Boolean,
29-
location: {
30-
type: String as PropType<typeof locations[number]>,
31-
default: 'bottom end',
32-
},
3328
offset: Boolean,
3429
modelValue: {
3530
type: Boolean,
@@ -38,6 +33,7 @@ export const makeVFabProps = propsFactory({
3833

3934
...omit(makeVBtnProps({ active: true }), ['location']),
4035
...makeLayoutItemProps(),
36+
...makeLocationProps(),
4137
...makeTransitionProps({ transition: 'fab-transition' }),
4238
}, 'VFab')
4339

@@ -65,13 +61,13 @@ export const VFab = genericComponent()({
6561
const position = computed(() => {
6662
if (!hasPosition.value) return false
6763

68-
return props.location.split(' ').shift()
64+
return props.location?.split(' ').shift() ?? 'bottom'
6965
}) as ComputedRef<Position>
7066

7167
const orientation = computed(() => {
7268
if (!hasPosition.value) return false
7369

74-
return props.location.split(' ')[1] ?? 'end'
70+
return props.location?.split(' ')[1] ?? 'end'
7571
})
7672

7773
useToggleScope(() => props.app, () => {

0 commit comments

Comments
 (0)