title: Hide input on submit (VUE)
body: <p>Im working on a Vue app - very simple said a todo list, like the following example. However i would like to hide my input field on submit (and hereby only show the output as it already does), so i can make a nice transition, since only one item should be added per input field. </p>
  
  <p>Hope someone can help me with a good solution!</p>
  
  <p><a href="https://jsfiddle.net/541rd96r/" rel="nofollow noreferrer">https://jsfiddle.net/541rd96r/</a></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>new Vue({
    el: "#madplan",
    data: {
      newTask_mandag: "",
      taskList_mandag: [],
    },
  
    methods: {
      addTask_mandag: function() {
        var task = this.newTask_mandag.trim();
        if (task) {
          this.taskList_mandag.push({
            text: task
          });
          this.newTask_mandag = "";
        }
      },
  
      removeSubTask_mandag: function(task) {
        var index = this.taskList_mandag.indexOf(task);
        this.taskList_mandag.splice(index, 1);
      },
    }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://unpkg.com/vue/dist/vue.js"&gt;&lt;/script&gt;
  
  &lt;div id="madplan"&gt;
    &lt;section&gt;
      &lt;section class="prefetch" class="panel"&gt;
        &lt;input class="input typeahead" type="text" placeholder="Tilføj ret til madplanen" v-model="newTask_mandag " v-on:keyup.enter="addTask_mandag"&gt;
      &lt;/section&gt;
  
      &lt;details v-for="task in taskList_mandag" v-bind:key="task.text" class="sub-list-item"&gt;
        &lt;summary&gt;{{ task.text }} &lt;button v-on:click="removeSubTask_mandag(task)"&gt;X&lt;/button&gt;&lt;/summary&gt;
  
      &lt;/details&gt;
    &lt;/section&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>