File tree 1 file changed +2
-2
lines changed
Filter options
packages/core/useElementSize
1 file changed +2
-2
lines changed
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ import type { UseResizeObserverOptions } from '../useResizeObserver'
4
4
import { useElementSize } from '@vueuse/core'
5
5
import { ref as deepRef , defineComponent , h , reactive } from 'vue'
6
6
7
- export const UseElementSize = /* #__PURE__ */ defineComponent < ElementSize & UseResizeObserverOptions & RenderableComponent > ( {
7
+ export const UseElementSize = /* #__PURE__ */ defineComponent < Partial < ElementSize > & UseResizeObserverOptions & RenderableComponent > ( {
8
8
name : 'UseElementSize' ,
9
9
props : [ 'width' , 'height' , 'box' , 'as' ] as unknown as undefined ,
10
10
setup ( props , { slots } ) {
11
11
const target = deepRef ( )
12
- const data = reactive ( useElementSize ( target , { width : props . width , height : props . height } , { box : props . box } ) )
12
+ const data = reactive ( useElementSize ( target , { width : props . width ?? 0 , height : props . height ?? 0 } , { box : props . box } ) )
13
13
14
14
return ( ) => {
15
15
if ( slots . default )
You can’t perform that action at this time.
0 commit comments