vue-resize-mixin

'resizer' event mixin for Vue.js

Showing:

Popularity

Downloads/wk

85

GitHub Stars

17

Maintenance

Last Commit

4yrs ago

Contributors

4

Package

Dependencies

1

Size (min+gzip)

1.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100