title: Vue v-if not updating
body: <p>Here's a part of my Vue template:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;ul&gt;
     &lt;li v-for="friend in user.friends"&gt;
         &lt;span v-if="checkIfNew(friend.id)"&gt; ... &lt;/span&gt;
     &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Basically, friends is an array of objects, and I want to display the span element, if we have new messages from any of them. That's what <code>checkIfNew()</code> does. It checks whether the friend's id is in the <code>unreadIds</code> array (it contains ids of friends, who sent a message)</p>
  
  <p>This array is being updated in a different method, but, here's the problem: <code>v-if</code> doesn't react to the changes.</p>
  
  <p>Here's a part of the script section:</p>
  
  <pre class="lang-js prettyprint-override"><code>data(){
     return {
        unreadIds: []
     }
  },
  methods:{
     checkIfNew(id){
        if(id in this.unreadIds) return true
        else return false
     }
  },
  computed:{
      user(){
        return this.$store.getters.user;
      }
  }
  </code></pre>
  
  <p>Does anyone have any ideas what am I doing wrong?</p>