title: vue set img height based on width with dynamic styling
body: <p>I have an image that should have 50% height of its width.</p>
  
  <pre><code>&lt;img :src="post.image" ref="image" :style="{ height: imageHeight + 'px' }" /&gt;
  
  imageHeight() {
              let image = this.$refs.image
              if(!image) return 0
              let height = image.clientWidth * 0.5
              return height
          }
  </code></pre>
  
  <p>Unfortunately image is undefined during the evaluation of imageHeight and it does not get reevaluated when the width changes. Is there some way to make it work with a watcher or some other way?</p>