Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9889fa0

Browse filesBrowse files
authored
fix(useElementSize): component type warning (#4722)
1 parent d3ed667 commit 9889fa0
Copy full SHA for 9889fa0

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

‎packages/core/useElementSize/component.ts

Copy file name to clipboardExpand all lines: packages/core/useElementSize/component.ts
+2-2
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.