title: Vuejs v-for remove element
body: <p>I have code like : </p>
  
  <pre><code>&lt;div id="files"&gt;
    &lt;div v-for="(file, key) in data.files" v-bind:id="key"&gt;
      @{{ file }}
      &lt;span v-on:click="removeFile(key)"&gt;
        &lt;button&gt;X&lt;/button&gt;
      &lt;/span&gt;
      &lt;button v-on:click="addFiles()"&gt;Add Files&lt;/button&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>File js </p>
  
  <pre><code>methods: {
     removeFile(key) {
         var elem = document.getElementById("#" + key);
         elem.parentNode.removeChild(elem);
         return false;
     }
  </code></pre>
  
  <p>When i clicked button, selected file had been deleted as well but it also returned error like: </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'parentNode' of null</p>
  </blockquote>
  
  <p>I tried this way but same problem: file had been removed, with error</p>
  
  <pre><code>var parent = document.getElementById("files");
  var child = document.getElementById("#" + key);
  
  parent.removeChild(child);
  </code></pre>
  
  <blockquote>
    <p>Uncaught TypeError: Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'.</p>
  </blockquote>
  
  <p>Any idea? Thanks so much!</p>