Install & Download:
# Yarn
$ yarn add vue-screen-size
# NPM
$ npm install vue-screen-size --saveDescription:
A Vue.js library to Get easy and reactive access to the width and height of your screen.
How to use it:
1. Import the vue-screen-size after you install the package.
import VueScreenSize from 'vue-screen-size'
2. Register the component.
Vue.use(VueScreenSize);
// or
export default {
...
mixins: [VueScreenSize.VueScreenSizeMixin],
...
}3. Get the screen size using the following variables.
- $vssWidth: The width of your screen
- $vssHeight: The height of your screen
- $vssEvent: The event object data from the resizing event
Preview:

Changelog:
v2.1.0 (03/18/2023)
- Upgrade to Vue 3