Vue Directive to detect resize events on elements or components. Uses element Resize Detector under the hood.

⚙️ Installation

$ npm install vue-fabric-wrapper

? How to use in Vue

In main.js

import resize from "vue-element-resize-detector";

  <div id="app">
    <h1>Vue Element Resize Detector</h1>
    <div v-resize @resize="onResize">This divs with is: {{ width }}</div>

export default {
  name: "app",
  data() {
    return {
      width: 0
  methods: {
    onResize(e) {
      console.log("resize event", e.detail.width, e.detail.height);
      this.width = e.detail.width;

#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;