Skip to content

Commit 9889fa0

Browse files
authored
fix(useElementSize): component type warning (#4722)
1 parent d3ed667 commit 9889fa0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/useElementSize/component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import type { UseResizeObserverOptions } from '../useResizeObserver'
44
import { useElementSize } from '@vueuse/core'
55
import { ref as deepRef, defineComponent, h, reactive } from 'vue'
66

7-
export const UseElementSize = /* #__PURE__ */ defineComponent<ElementSize & UseResizeObserverOptions & RenderableComponent>({
7+
export const UseElementSize = /* #__PURE__ */ defineComponent<Partial<ElementSize> & UseResizeObserverOptions & RenderableComponent>({
88
name: 'UseElementSize',
99
props: ['width', 'height', 'box', 'as'] as unknown as undefined,
1010
setup(props, { slots }) {
1111
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 }))
1313

1414
return () => {
1515
if (slots.default)

0 commit comments

Comments
 (0)