vue-resize
Vue 2.x component to detect DOM elements resizing (event based/no window.onresize)
Detect DOM element resizing.
Installation
npm install --save vue-resize
Module import
⚠️ You need to include the package CSS:
Then import the package and install it into Vue:
Or:
Browser
The plugin should be auto-installed. If not, you can install it manually:
Or:
Usage
Add the <resize-observer>
inside a DOM element and make its position to something other than 'static'
(for example 'relative'
), so that the observer can fill it.
Listen to the notify
event that is fired when the above DOM element is resized.