
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
vue-resize
Advanced tools
Detect DOM element resizing
npm install --save vue-resize
⚠️ You need to include the package CSS:
import 'vue-resize/dist/vue-resize.css'
Then import the package and install it into Vue:
import Vue from 'vue'
import VueResize from 'vue-resize'
Vue.use(VueResize)
Or:
import Vue from 'vue'
import { ResizeObserver } from 'vue-resize'
Vue.component('resize-observer', ResizeObserver)
<link rel="stylesheet" href="vue-resize/dist/vue-resize.css"/>
<script src="vue.js"></script>
<script src="vue-resize/dist/vue-resize.min.js"></script>
The plugin should be auto-installed. If not, you can install it manually:
Vue.use(VueResize)
Or:
Vue.component('resize-observer', VueResize.ResizeObserver)
Add the <resize-observer> inside a DOM element and make its position to something other than 'static' (for example 'relative'), so that the observer can fill it.
Listen to the notify event that is fired when the above DOM element is resized.
<template>
<div class="demo">
<h1>Hello world!</h1>
<resize-observer @notify="handleResize" />
</div>
</template>
<script>
export default {
methods: {
handleResize ({ width, height }) {
console.log('resized', width, height)
}
}
}
</script>
<style scoped>
.demo {
position: relative;
}
</style>
The vue-resize-directive package provides a simple directive to detect element resize events. It is similar to vue-resize but focuses solely on the directive aspect without additional features like the ResizeObserver.
The vue-resize-sensor package offers a component-based approach to detecting element resize events. It provides a `ResizeSensor` component that you can wrap around any element to listen for resize events. This package is more component-oriented compared to vue-resize.
The vue-element-resize-detector package is another alternative for detecting element resize events. It uses the `element-resize-detector` library under the hood and provides a Vue.js directive for easy integration. It is similar in functionality to vue-resize but uses a different underlying library.
FAQs
Detects DOM element resizing
The npm package vue-resize receives a total of 358,071 weekly downloads. As such, vue-resize popularity was classified as popular.
We found that vue-resize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.