title: Vue equivalent of setTimeout?
body: <p>I'm making a shopping cart system with Laravel and Vue. When I add an item to the basket, I display a confirmation message by toggling a Vue variable being watched by a v-if:</p>
  
  <pre><code>&lt;div class="alert alert-success" v-if="basketAddSuccess" transition="expand"&gt;Added to the basket&lt;/div&gt;
  </code></pre>
  
  <p>And the JS:</p>
  
  <pre><code>addToBasket: function(){
                  item = this.product;
                  this.$http.post('/api/buy/addToBasket', item);
                  this.basketAddSuccess = true;
              }
  </code></pre>
  
  <p>(And yes, I will be adding this in a then-catch shortly).</p>
  
  <p>This works fine and the message appears. However, I'd like the message to disappear again after a certain time, say a few seconds. How can I do this with Vue? I've tried <code>setTimeOut</code> but Vue doesn't seem to like it, saying it's undefined.</p>
  
  <p>EDIT: I was misspelling <code>setTimeout</code> like an idiot. However, it still doesn't work:</p>
  
  <p>My function is now:</p>
  
  <pre><code>addToBasket: function(){
                  item = this.photo;
                  this.$http.post('/api/buy/addToBasket', item);
                  this.basketAddSuccess = true;
                  setTimeout(function(){
                      this.basketAddSuccess = false;
                  }, 2000);
              }
  </code></pre>