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.
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={(rect) => {
console.log('resized!', rect);
}}
>
<textarea />
</ResizeObserver>
)
}
}
name | type | default | description |
---|---|---|---|
disabled | boolean | false |
Disable current observer instance |
name | type | default | description |
---|---|---|---|
resize | ({ width, height, offsetWidth, offsetHeight })=>void | -- | Trigger resize listener function when child node resized |
MIT