[Vuejs]-Vue pass pre-determined value

1👍

You can set the v-model to property.property_name, this way it will have its initial value and will update the list on change:

new Vue({
  el:"#app",
  data: () => ({
    properties: [
      { property_name:'property_name1' }, { property_name:'property_name2' },
    ]
  })
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
  {{properties}}
  <div v-for="(property, propIndex) in properties" :key="propIndex">
    <input type="text" v-model="property.property_name"><br>
  </div>
</div>

Leave a comment