title: Add css animation before deleting array item
body: <p>I would like to do a css animation before deleting an item from my data table. The deletion of an element is triggered by an event <code>@click</code>. So I'd like to see first what my animation does (class <code>delete_animation</code>) and only after delete the element.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var vm = new Vue({
    el: '#app',
    data: {
     addedId: null,
    array: [
       { id: 1, text: "lorem ipsum" },
        { id: 2, text: "lorem ipsum" },
      ]
    },
    methods: {
     add() {
       this.addedId = this.array[this.array.length - 1].id + 1;
        this.array.push({ id: this.addedId, text: "lorem ipsum"} );
      },
      remove(item, index) {
        this.array.splice(index, 1);
        this.addedId = null;
        // ???
      }
    }
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>table {
      border-collapse: collapse;
  }
  
  table, th, td {
      border: 1px solid black;
  }
  
  .add_animation {
    animation: addItem 1s;
  }
  
  @keyframes addItem {
    0% {
      background-color: green;
    }
    100% {
      background-color: white;
    }
  }
  .deleted_animation {
    animation: deleteItem 1s;
  }
  @keyframes deleteItem {
    0% {
      background-color: red;
    }
    100% {
      background-color: white;
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.11/vue.min.js"&gt;&lt;/script&gt;
  &lt;div id="app"&gt;
    &lt;table&gt;
      &lt;tr v-for="(index, item) in array" :key="item.id" :class="addedId == item.id ? 'add_animation' : ''"&gt;
        &lt;td&gt;{{ item.text }}&lt;/td&gt;
        &lt;td&gt; &lt;button type="button" @click="remove(item, index)"&gt;remove&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
    &lt;button type="button" @click="add()"&gt;Add&lt;/button&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I would simply like to do the opposite of what the "add" button does. However, I do not see how to handle events to wait for the animation to display. I think i need to trigger click once my animation was displayed, but i don't know how...</p>
  
  <p>Thanks !</p>