Vue.js 2.0 directive to detect element resize
npm install vue-resize-directiveonResize function will be called each time the element resizes with the corresponding HTML element as only argument.
javascript
`
$3
Use throttle when you need to rate-limit resize events frequency.
* With default timeout (150 ms):
`HTML
`
* With custom timeout (in ms):
`HTML
`
$3
Use debounce when you only need to be notified when resize events ends.
* With default timeout (150 ms):
`HTML
`
* With custom timeout (in ms):
`HTML
`
$3
Use this option to receive the resize callback right after the element is mounted on the DOM and visible.
`HTML
`
Installation
- Available through npm:
` js
npm install vue-resize-directive --save
`
- For Modules
` js
// ES6
import resize from 'vue-resize-directive'
//...
export default {
directives: {
resize,
}
//...
// ES5
var resize = require('vue-resize-directive')
`
- #### For