detect container resizing
Clone or download
Latest commit a8ad409 Nov 6, 2017
Permalink
Failed to load latest commit information.
src - use esm Nov 5, 2017
.babelrc - keep vue-resize-sensor compatible with cjs Apr 27, 2017
.gitignore Initial commit Apr 6, 2017
.npmignore - add source Apr 6, 2017
LICENSE Initial commit Apr 6, 2017
README.md - use esm Nov 5, 2017
package.json 2.0.0 Nov 5, 2017

README.md

vue-resize-sensor

detect container resizing.

  • event based
  • no window.onresize
  • no interval/timeout detection
  • no CSS modifications
  • no Javascript-Framework dependency

Example

<template>
  <div>
    <resize-sensor @resize="resize"></resize-sensor>
  </div>
</template>

API

props

initial Boolean

Request an initial size event.

events

@resize Object

A size object { width, height }

Browser support

Same browser support as Vue.js 2

Note

since v2.x, the script is exported as esm.

Credits

Franck Freiburger