Requires :
options
(Object)element
(Object) (defaultwindow
) Event targettouch
(Boolean) (defaultfalse
) Enables touch eventrelative
(Boolean) (defaultfalse
) 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
setup() {
const { x: mouseX, y: mouseY } = useOnMouseMove();
return { mouseX, mouseY };
setup() {
const div = ref(null);
return { ...useOnMouseMove({ element: div, touch: true }) };
}