Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 429 Bytes

useOrientation.md

File metadata and controls

31 lines (23 loc) · 429 Bytes

useOrientation

Vue sensor hook that tracks screen orientation of user's device.

Returns state in the following shape

{
  angle: 0,
  type: 'landscape-primary'
}

Usage

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

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

      return () => (
          <pre>
              {JSON.stringify(state, null, 2)}
          </pre>
      );
  }
};