vue-window-resize

Description A very simple vue component to have a window width and height reactive values on window resize.
917
Install
npm install vue-window-resize
Latest Version:1.0.6
Vue:2
License:MIT
Last Updated:Mar 4, 2023
Links: GitHub  ·  npm
Maintainer: stefanaz

vue-window-resize

Description

A very simple vue component to have a window width and height reactive values on window resize.

Install and basic usage:

npm install --save vue-window-resize@latest

Usage:

Window variable is reactive and shows actual width/height on window resize.

    <VueWindowResize v-show="false" v-model="window"/>
    ...
    export default {
        data() {
          return {
                window: {
                    width: 0,
                    height: 0
                },
            }
        }
        // rest of the component
    }
    ...

Register the component globally

import Vue from 'vue'
import VueWindowResize from 'vue-window-resize'
Vue.component('VueWindowResize', VueWindowResize)

Register the component locally

import VueWindowResize from 'vue-window-resize';

export default {
  components: {
    VueWindowResize,
  },
  // rest of the component
}

Register via <script> tag

<script src="https://unpkg.com/vue-window-resize@1.0.4/dist/vue-window-resize.umd.min.js"></script>

...
<vue-window-resize v-model="window"></vue-window-resize>
...

Related Packages

vue-resize-text

Vue Resize Text makes font auto resizing on responsive layout

30,606 69
vue-check-view

Simple vue plugin that checks element position on screen (viewport) and adds cla...

99,472 112
vue3-resize-text

Vue 3 Resize Text makes font auto resizing on responsive layout

54,488 12
@vesperjs/vue

This is Vesper for Vue.js.

8,552 1
@wzpo/md-ui

Another Momentum UI framework for Vue.js applications

2,054

Version History

Version Released Vue License
1.0.6 ^2.6.11 MIT
1.0.5 ^2.6.11 MIT
1.0.4 ^2.6.11 MIT
1.0.3 ^2.6.11
1.0.2 ^2.6.11