vue-resize-mixin

2.0.0 • Public • Published

Vue resize mixin

Vue 2.0+

Install

With npm do:

$ npm i -S vue-resize-mixin

With bower do:

$ bower install vue-resize-mixin --save 

Usage:

var resizeMixin = require('vue-resize-mixin');
 
var vm = new Vue({
  mixins: [resizeMixin],
 
  events: {
    'resize': 'onResize'
  },
 
  methods: {
    onResize: function(event) {
      var width = event.width;
      var height = event.height;
    }
  }
})

The mixin emits an internal resize event. You could also this.$on('resize', this.onResize);

The emitted event has 2 properties, width and height (of the window).

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i vue-resize-mixin

Weekly Downloads

111

Version

2.0.0

License

MIT

Last publish

Collaborators

  • ayamflow
  • kewah