vue-use-screen-orientation
A Vue composable for detecting screen orientation using media query.
Installation
npm install vue-use-screen-orientation
Usage
<script setup>
import useScreenOrientation from 'vue-use-screen-orientation'
const orientation = useScreenOrientation()
</script>
<template>
<div>Orientation: {{ orientation }}</div>
</template>
Why?
- orientationchange event is deprecated.
- screen.orientation has patchy support.
License
MIT