1. vue-size-observer
A vue component to observe element size changing.
vue-size-observer
Package: vue-size-observer
Created by: givingwu
Last modified: Mon, 23 May 2022 18:49:46 GMT
Version: 0.0.3
License: MIT
Downloads: 56
Repository: https://github.com/givingwu/vue-size-observer

Install

npm install vue-size-observer
yarn add vue-size-observer

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

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin