Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 419 Bytes

useWindowScroll.md

File metadata and controls

25 lines (20 loc) · 419 Bytes

useWindowScroll

Vue sensor hook that re-renders on window scroll.

Usage

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

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

      return () => {
          const {x, y} = state;
          return (
              <div>
                  <div>x: {x}</div>
                  <div>y: {y}</div>
              </div>
          )
      };
  }
};