title: In VueJs offsetHeight is 0 after mounted
body: <p>This is NOT a duplicate of <a href="https://stackoverflow.com/questions/384145/expanding-a-parent-div-to-the-height-of-its-children">Expanding a parent &lt;div&gt; to the height of its children</a>. @craig_h's answer perfectly solved my question.</p>
  
  <p>When I try to get the <code>offsetHeight</code> of the <code>$el</code> in the <code>mounted</code> hook, it returns 0.</p>
  
  <p>Here is a jsfiddle: <a href="https://jsfiddle.net/BraveOstrich/zey5eL5v/11/" rel="nofollow noreferrer">https://jsfiddle.net/BraveOstrich/zey5eL5v/11/</a>. </p>
  
  <pre><code>//HTML
  &lt;div id="app"&gt;
    &lt;div class="test"&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  //JS
  new Vue({
    el: '#app',
    mounted() {
      console.log('$el.offsetHeight', this.$el.offsetHeight)
    }
  })
  </code></pre>
  
  <p>In log, it shows <code>$el.offsetHeight 0</code>.</p>