Watch height of an element in VueJS Watch height of an element in VueJS vue.js vue.js

Watch height of an element in VueJS


You could use the ResizeObserver and integrate it into your Vue-Component

function observeHeight() {  const resizeObserver = new ResizeObserver(function() {     console.log("Size changed");  }); resizeObserver.observe(document.getElementById('yourId'));}function changeHeight() {  var elem = document.getElementById('yourId');    console.log('...loading data...')  setTimeout(function(){     elem.style = "height: 200px";  }, 3000);  }observeHeight();changeHeight();
#yourId {  background-color: beige;  height: 100px;}
<div id="yourId">  </div>