title: Access $el inside a computed property
body: <p>I'm trying to access this.$el.offsetTop in a computed property, but get the error:</p>
  
  <pre><code>Cannot read property 'offsetTop' of undefined
  </code></pre>
  
  <p>How can I access the offsetTop of the component in a computed method? if this is not possible then is there an alternative?</p>
  
  <p>Component:</p>
  
  <pre><code>&lt;template&gt;
      &lt;div :class="{ 'active' : test }"&gt;&lt;/div&gt;
  &lt;/template&gt;
  &lt;script&gt;
  export default {
  
      computed: {
  
          test() {
             console.log(this.$el.offsetTop);
          }
      }
  }
  &lt;/script&gt;
  </code></pre>