Provides reactive size properties for an element.
The target element to observe.
Optional
Optional configuration options.
An object containing reactive height and width properties, and a function to stop observing the target.
const element = useTemplateRef<Element>('element') const { height, width } = useElementSize(element) watchEffect(() => { console.table([{ height: height.value, width: width.value }]) }) Copy
const element = useTemplateRef<Element>('element') const { height, width } = useElementSize(element) watchEffect(() => { console.table([{ height: height.value, width: width.value }]) })
Provides reactive size properties for an element.