Description
Vue.resize is a Vue directive that detects when an HTML element changes size. It is based on CSS element queries and adds options for debouncing and throttling, so you can control how often the handler runs. The simple option calls your onResize function every time the element resizes and passes the element as the only argument. Throttle limits how often the function runs, with a default timeout of 150 milliseconds or a custom value in milliseconds. Debounce waits until resize events end and then calls the function, again with a default of 150 milliseconds or a custom timeout. An initial option sends a resize callback as soon as the element is mounted on the DOM and visible. The README includes a live demo, and it shows how to use the package with modules. Installation is available through npm.…
Highlights
- Detects element resize with a Vue directive
- Throttle and debounce options
- Initial callback on mount
- Based on CSS element queries
Ratings & Reviews
No ratings yet
Be the first to rate vue-resize-directive.
People also visit
vue-resize-directive FAQ
What is Vue.resize?
A Vue directive that detects resize events on an HTML element, with debounce and throttle options.
How do I install it?
It is available through npm. The README also has a section for plain script tags, which need css-element-queries and lodash.
What is the difference between throttle and debounce?
Throttle limits how often your function runs during resizing. Debounce waits until resizing ends, then calls it once.
Which Vue version is it for?
The README describes it as a Vue 2.0 directive.
What is the default timeout?
The default throttle and debounce timeout is 150 milliseconds, and you can set a custom value.
What are the best vue-resize-directive alternatives?
Popular alternatives to vue-resize-directive include vue-draggable-resizable, react-resize-aware and v-viewer. See all vue-resize-directive alternatives





















