vue-size-observer
v0.0.3
Published
A vue component to observe element size changing.
Downloads
64
Maintainers
Readme
vue-size-observer
Resize observer for Vue - A vue component to observe the element size changing that implements by resize-observer-polyfill and inspired from rc-resize-observer.
Usage
CodeSandBox demo or run example in Terminal with npm:
npm install
npm run serve
Code example:
import ResizeObserver from 'vue-size-observer';
export default {
render() {
return (
<ResizeObserver
onResize={() => {
console.log('resized!');
}}
>
<textarea />
</ResizeObserver>,
)
}
}
API
Props
|name|type|default|description|
|:-|:-|:-|:-|
|disabled|boolean|false
|Disable current observer instance|
Event
|name|type|default|description| |:-|:-|:-|:-| |resize|({ width, height, offsetWidth, offsetHeight })=>void|--|Trigger resize listener function when child node resized|
license
MIT