@@ -6,6 +6,7 @@ import { makeVBtnProps, VBtn } from '@/components/VBtn/VBtn'
6
6
7
7
// Composables
8
8
import { makeLayoutItemProps , useLayoutItem } from '@/composables/layout'
9
+ import { makeLocationProps } from '@/composables/location'
9
10
import { useProxiedModel } from '@/composables/proxiedModel'
10
11
import { useResizeObserver } from '@/composables/resizeObserver'
11
12
import { useToggleScope } from '@/composables/toggleScope'
@@ -16,20 +17,14 @@ import { computed, ref, shallowRef, toRef, watchEffect } from 'vue'
16
17
import { genericComponent , omit , propsFactory , useRender } from '@/util'
17
18
18
19
// Types
19
- import type { ComputedRef , PropType } from 'vue'
20
+ import type { ComputedRef } from 'vue'
20
21
import type { Position } from '@/composables/layout'
21
22
22
- const locations = [ 'start' , 'end' , 'left' , 'right' , 'top' , 'bottom' ] as const
23
-
24
23
export const makeVFabProps = propsFactory ( {
25
24
app : Boolean ,
26
25
appear : Boolean ,
27
26
extended : Boolean ,
28
27
layout : Boolean ,
29
- location : {
30
- type : String as PropType < typeof locations [ number ] > ,
31
- default : 'bottom end' ,
32
- } ,
33
28
offset : Boolean ,
34
29
modelValue : {
35
30
type : Boolean ,
@@ -38,6 +33,7 @@ export const makeVFabProps = propsFactory({
38
33
39
34
...omit ( makeVBtnProps ( { active : true } ) , [ 'location' ] ) ,
40
35
...makeLayoutItemProps ( ) ,
36
+ ...makeLocationProps ( ) ,
41
37
...makeTransitionProps ( { transition : 'fab-transition' } ) ,
42
38
} , 'VFab' )
43
39
@@ -65,13 +61,13 @@ export const VFab = genericComponent()({
65
61
const position = computed ( ( ) => {
66
62
if ( ! hasPosition . value ) return false
67
63
68
- return props . location . split ( ' ' ) . shift ( )
64
+ return props . location ? .split ( ' ' ) . shift ( ) ?? 'bottom'
69
65
} ) as ComputedRef < Position >
70
66
71
67
const orientation = computed ( ( ) => {
72
68
if ( ! hasPosition . value ) return false
73
69
74
- return props . location . split ( ' ' ) [ 1 ] ?? 'end'
70
+ return props . location ? .split ( ' ' ) [ 1 ] ?? 'end'
75
71
} )
76
72
77
73
useToggleScope ( ( ) => props . app , ( ) => {
0 commit comments