title: VueJS - Get child width using $refs
body: <p>I'm trying to extract the <code>clientWidth</code> of a child component inside VueJS. I'm calling <code>$refs</code> inside <code>mounted</code>, and assign its value to some data:</p>
  <pre class="lang-js prettyprint-override"><code>this.width = this.$refs.refName.clientWidth
  </code></pre>
  <p>The issue is that the width of this component is defined as 100% the one of its parent. But according to Vue lifecycle, the child DOM will be mounted before its parent. That causes the width in the child to always be 0 at mounted, because its parent isn't rendered yet.<br />
  My only solution would be to hardcode values in CSS, but I'd like to avoid that. What is the best way to achieve the desired effect?</p>