mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
useWindowSize
function useWindowSize(options: WindowSizeOptions = { throttle: 100 }): { width: Ref<number>; height: Ref<number>; }
Returns the window's width and height in an object. These values are reactive.
The optional options parameter allows you to set the throttling speed.
Usage
import { defineComponent } from '@vue/composition-api';
import { useWindowSize } from '@/composables/use-window-size/';
export default defineComponent({
setup(props) {
const { width, height } = useWindowSize();
}
});