Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-resize

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-resize

Detect DOM element resizing

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
651K
increased by5.45%
Maintainers
1
Weekly downloads
 
Created

What is vue-resize?

The vue-resize package is a Vue.js directive that allows you to detect and respond to changes in the size of an element. It is useful for creating responsive components that need to adjust their layout or behavior based on the size of their container.

What are vue-resize's main functionalities?

Resize Directive

The resize directive allows you to bind a method to be called whenever the element is resized. In this example, the `onResize` method will be called, logging the resize event to the console.

<template>
  <div v-resize="onResize">
    Resize me!
  </div>
</template>

<script>
export default {
  methods: {
    onResize(event) {
      console.log('Element resized:', event);
    }
  }
};
</script>

Resize Event

You can also use the `ResizeObserver` directive to listen for resize events on an element. This example shows how to import and use the `ResizeObserver` directive to call the `onResize` method when the element is resized.

<template>
  <div @resize="onResize">
    Resize me!
  </div>
</template>

<script>
import { ResizeObserver } from 'vue-resize';

export default {
  directives: {
    ResizeObserver
  },
  methods: {
    onResize(event) {
      console.log('Element resized:', event);
    }
  }
};
</script>

Other packages similar to vue-resize

Keywords

FAQs

Package last updated on 18 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc