/vue-composable-list

A composable list for Vue3

Primary LanguageJavaScript

onMouseMove([element])

onMouseMove([options])

Requires :

  • options (Object)
    • element (Object) (default window) Event target
    • touch (Boolean) (default false) Enables touch event
    • relative (Boolean) (default false) Computes provided coordinates relative to the event target

Provides :

  • x (Number)
  • y (Number)
  • removeEvent (Function)
    • Returns (Boolean)
  • addEvent (Function)
    • Returns (Boolean)

Provides a set of functions and properties in order to use the mousemove event.

If touch event is activated, the first touch point (finger) will be choosed

Example 1
setup() {
  const { x: mouseX, y: mouseY } = useOnMouseMove();
  return { mouseX, mouseY };
Example 2
setup() {
  const div = ref(null);
  return { ...useOnMouseMove({ element: div, touch: true }) };
}