We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 223d069 commit 8611976Copy full SHA for 8611976
packages/core/useMouseInElement/index.ts
@@ -1,6 +1,7 @@
1
import { MaybeRef } from '@vueuse/shared'
2
import { ref, watch } from 'vue-demi'
3
import { MouseOptions, useMouse } from '../useMouse'
4
+import { defaultWindow } from '../_configurable'
5
6
export interface MouseInElementOptions extends MouseOptions {
7
handleOutside?: boolean
@@ -17,7 +18,10 @@ export function useMouseInElement(
17
18
target?: MaybeRef<Element | null | undefined>,
19
options: MouseInElementOptions = {},
20
) {
- const { handleOutside = true } = options
21
+ const {
22
+ handleOutside = true,
23
+ window = defaultWindow,
24
+ } = options
25
const { x, y, sourceType } = useMouse(options)
26
27
const targetRef = ref(target || window?.document.body)
0 commit comments