Get Screen Size In Vue App – vue-screen-size

Get Screen Size In Vue App – vue-screen-size

  • 328

A Vue.js library to Get easy and reactive access to the width and height of your screen.

Description:

A Vue.js library to Get easy and reactive access to the width and height of your screen.

Install & Download:

# Yarn
$ yarn add vue-screen-size

# NPM
$ npm install vue-screen-size --save

How to use it:

  1. Import the vue-screen-size after you install the package.
import VueScreenSize from 'vue-screen-size'
  1. Register the component.
Vue.use(VueScreenSize);
// or
export default {
  ...
  mixins: [VueScreenSize.VueScreenSizeMixin],
  ...
}
  1. 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

Download Details:

Author: johndatserakis

Live Demo: https://johndatserakis.github.io/vue-screen-size/

Download Link: https://github.com/johndatserakis/vue-screen-size/archive/master.zip

Official Website: https://github.com/johndatserakis/vue-screen-size