useElementByPoint
Reactive element by point.
Demo
Usage
ts
import { useElementByPoint, useMouse } from '@vueuse/core'
const { x, y } = useMouse({ type: 'client' })
const { element } = useElementByPoint({ x, y })
import { useElementByPoint, useMouse } from '@vueuse/core'
const { x, y } = useMouse({ type: 'client' })
const { element } = useElementByPoint({ x, y })
Type Declarations
typescript
export interface UseElementByPointOptions {
x: MaybeComputedRef<number>
y: MaybeComputedRef<number>
}
/**
* Reactive element by point.
*
* @see https://vueuse.org/useElementByPoint
* @param options - UseElementByPointOptions
*/
export declare function useElementByPoint(options: UseElementByPointOptions): {
isActive: Ref<boolean>
pause: Fn
resume: Fn
element: Ref<HTMLElement | null>
}
export declare type UseElementByPointReturn = ReturnType<
typeof useElementByPoint
>
export interface UseElementByPointOptions {
x: MaybeComputedRef<number>
y: MaybeComputedRef<number>
}
/**
* Reactive element by point.
*
* @see https://vueuse.org/useElementByPoint
* @param options - UseElementByPointOptions
*/
export declare function useElementByPoint(options: UseElementByPointOptions): {
isActive: Ref<boolean>
pause: Fn
resume: Fn
element: Ref<HTMLElement | null>
}
export declare type UseElementByPointReturn = ReturnType<
typeof useElementByPoint
>
Source
Contributors
Anthony Fu
wheat
BaboonKing
Jelf