Category | Elements |
---|---|
Export Size | 532 B |
Last Changed | last year |
Reactively track window focus with window.onfocus
and window.onblur
events.
import { useWindowFocus } from '@vueuse/core' const focused = useWindowFocus()
This function also provides a renderless component version via the
@vueuse/components
package. Learn more about the usage.
<UseWindowFocus v-slot="{ focused }"> Document Focus: {{ focused }} </UseWindowFocus>
/** * Reactively track window focus with `window.onfocus` and `window.onblur`. * * @see https://vueuse.org/useWindowFocus * @param options */ export declare function useWindowFocus({ window, }?: ConfigurableWindow): Ref<boolean>
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/core/useWindowFocus/