Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 477 Bytes

useWindowSize.md

File metadata and controls

25 lines (20 loc) · 477 Bytes

useWindowSize

Vue sensor hook that tracks dimensions of the browser window.

Usage

import {useWindowSize} from 'vue-next-use';

const Demo = {
    setup() {
        const state = useWindowSize();

        return () => {
            const {width, height} = state;
            return (
                <div>
                    <div>width: {width}</div>
                    <div>height: {height}</div>
                </div>
            )
        };
    }
};