did-resize
This modifier triggers a callback when resize events are observed on the target element.
Basic Usage
A callback handler is always expected to be passed to did-resize
:
<div ></div>
The handler will be called with an instance of ResizeObserverEntry and the ResizeObserver instance itself:
onResize(entry, observer) {
// do something
}
Here is an example of using the did-resize
modifier to increment a counter every time the containing <div>
has been resized:
I have been resized 0 times!
<div >I have been resized times!</div>
Advanced Usage
did-resize
also supports passing an options
hash into ResizeObserver:
<div ></div>
The options supported are documented under ResizeObserver.observe.