Skip to content
On this page

useElementByPoint

Category
Last Changed
a month ago

Reactive element by point.

Demo

source

x:
y:

Usage

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

export interface UseElementByPointOptions {
  x: MaybeRef<number>
  y: MaybeRef<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: MaybeRef<number>
  y: MaybeRef<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

SourceDemoDocs

Contributors

Anthony Fu
BaboonKing
wheat
Jelf

Changelog

v7.3.0 on 12/12/2021
3edf7 - feat: new function (#1022)
useElementByPoint has loaded