title: Vue.js - Recompute computed property in a component
body: <p>I searched this problem a lot with no direct answer found.
  I have a computed property that depends also on the window height so I need it to be recomputed every time the window is resized. Tried using <code>$forceUpdate()</code> but I think it doesn't work with components. Here is my component : </p>
  
  <pre><code>Vue.component('trades-component', {
  
    mixins: [tradingMixin],
  
    created: function() {
      var that = this;
      // recompute visible trades if window resized
      $( window ).on( "resize", function() {
        that.$forceUpdate();
      });
      $( window ).resize();
    },
  
    computed: {
  
      visibleTradesCount: function() {
        var colOffset = $(".left-col").offset();
        var colHeight = $(".left-col").height();
        var tableOffset = $(".left-col #trade-history table").offset();
        var tableHeight = colHeight - (tableOffset.top - colOffset.top) - this.rowHeight;
        return Math.floor(tableHeight / this.rowHeight)
      }
    }
  })
  </code></pre>
  
  <p>I know possible workarounds but want to know if there is a way to force recomputing a particular property or all computed properties in components.</p>