title: Vue.js input values not updating after data is modified
body: <p>I just started working with Vue.js and I'm facing some issues with the Vue.js reactive datasources. </p>
  
  <p>The following code should be able to add and remove a row containing a textfield and a textarea in the parent element. </p>
  
  <p>ElementsView.vue</p>
  
  <pre><code>&lt;template&gt;
      &lt;div&gt;
          &lt;label&gt;&lt;/label&gt;
          &lt;br&gt;
          &lt;small class='text-muted'&gt;&lt;/small&gt;
          &lt;br&gt;
          &lt;div class='marks_content'&gt;
              &lt;div class='row' v-for="(item, index) in marks" v-bind:key="index"&gt;
  
                  &lt;div class='col-md-12 mark_header_container'&gt;
                      &lt;div class="numerator-element"&gt;
                          &lt;span class="numerator-content"&gt;{{ index + 1 }}&lt;/span&gt;
                      &lt;/div&gt;
                      &lt;div class="remove-button" v-on:click="removeMark(index)"&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
  
                  &lt;div class='col-md-6'&gt;
                      &lt;TextField :element-id='"term_textfield" + index' :message="item.term" type='text' placeholder="Kenmerk / element / fase"&gt;&lt;/TextField&gt;
                  &lt;/div&gt;
  
                  &lt;div class='col-md-6'&gt;
                      &lt;TextField :element-id='"desc_textfield" + index ' :optional="true" :message="item.description" type='text' placeholder="Beschrijving (optioneel)" multiline="true"&gt;&lt;/TextField&gt;
                  &lt;/div&gt;
  
  
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class='row'&gt;
  
              &lt;div class='col-md-6'&gt;
                 &lt;div class="form-check"&gt;
                      &lt;input type="checkbox" class="form-check-input" id="order_check"&gt;
                      &lt;label class="form-check-label" for="order_check"&gt;Volgorde van belang (bij fases)&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class='col-md-6 right_column'&gt;
                  &lt;a href="#" v-on:click="addMark"&gt;Nieuwe rij toevoegen&lt;/a&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/template&gt;
  &lt;script&gt;
  
  
  import TextField from './TextField.vue'
  export default {
      props: ['elements'],
      name: 'ElementsView', 
      components: {
          TextField
      },
      data() {
          return {
              marks: [{}]
          }
      },
      mounted() {
          if (this.elements) {
              if (this.elements.length &gt; 0) {
                   this.marks = this.elements;
              }
          }
  
      },
      methods: {
          addMark: function (e) {
              this.marks.push({ 'term': '', 'description': ''}); //I thought the issue might be related to having undefined values, so I changed it to empty strings
          }, 
          removeMark: function(index) {
              //this.marks = [{ 'term': 'term1', 'description': 'desc1'}, { 'term': 'term12', 'description': 'desc13'}]
  
              this.marks.splice(index, 1);
          }
      }
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>TextField.vue</p>
  
  <pre><code>&lt;template&gt;
    &lt;div class="form-group"&gt;
      &lt;label v-if="title" :for="elementId"&gt;{{title}}&lt;/label&gt;
  
      &lt;textarea v-if="multiline" v-bind:class="{ optional: optional }" rows="1" :type="type" class="form-control" :id="elementId" :aria-describedby="elementId + '_help'"  :placeholder="placeholder" v-model="messageValue"&gt;&lt;/textarea&gt;
      &lt;Input :value="message" v-bind:class="{ optional: optional }" v-else rows="1" :type="type" class="form-control" :id="elementId" :aria-describedby="elementId + '_help'"  :placeholder="placeholder"/&gt;
  
        &lt;small v-if="help" :id="elementId + '_help'" class="form-text text-muted"&gt;{{help}}&lt;/small&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  
  import autosize from 'autosize';
  
  export default {
    props: ['elementId', 'type', 'title', 'help', 'placeholder', 'multiline', 'message', 'optional'],
    name: 'TextField',
    data() {
        return {
            messageValue: this.message
        }
    },
    mounted() {
        var root = this.$el;
        var textAreas = root.getElementsByTagName("TextArea");
        if (textAreas.length &gt; 0) {
              var area = textAreas[0];
              autosize(area);
          }
    }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I want to have an empty row at the starting point, indicated by the marks: [{}] in the code. Whenever a user wants to add a new row a new empty json object is added to the array. This works fine, however deleting the object causes errors. </p>
  
  <p>The array consist of empty objects that are not bind to any input in the row elements, therefore the array consists of empty JSON objects. Because of this I would expect the interface to rerender the number of row elements - 1 after an element is deleted and do not show any text that was written by the user earlier.</p>
  
  <p>This is not the case, the input that the user earlier entered remains visible even though the new objects are empty. This happens for both the addMark function (which is not problem, but not what I expected) and happens for the removeMark function (I see a random row disappear). </p>
  
  <p>Originally I assumed that it was necessary to update the data that the list relies on before mutating it as this would force it to be redrawn with the array from the data object. </p>
  
  <p>In order to test this assumption, I tried to assign a different array in the removeMark function (just for testing purposes) and see what happens. When the input is not modified this seems to work partly but when the input is modified this new array value is being overwritten. </p>
  
  <p>Can someone please point out what I'm doing wrong? </p>