title: Vue - set v-model dynamically (with a variable containing a string)
body: <p>I haven't been able to set v-model dynamically. </p>
  
  <p>It works if I type explicitly:</p>
  
  <pre><code> &lt;div class="form-group mr-3 mb-2"&gt;
       &lt;input type="text"  
         v-model="form[filters][firstlastname]" 
       &gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>But I want to loop through an object wherein I have string , like: 'form[filters][firstlastname]'</p>
  
  <p>The parent has the form with properties: </p>
  
  <pre><code>data() {
     return {
       form: new Form({
          filters: {
          gender: [],
          firstlastname: 'My firstlastname'
  </code></pre>
  
  <p>So, from the parent I pass down the form and filters into the child component, here is filters:</p>
  
  <pre><code>  let formFilters = { filters: [
        {
           type: 'text',
           property: 'form[filters][firstlastname]',        // &lt;-- string 
          placeholder: 'Name',
       },
       {
          type: 'number',
          property: 'paginate', 
          placeholder: 'Max rows'
       },
     ]
  }
  </code></pre>
  
  <p>Child component: (here I loop through the object and generate the input fields)</p>
  
  <pre><code>&lt;div v-for="(filter,index) in formFilters.filters" 
         :key="`${index}_${filter.property}`"
     &gt;
        &lt;input 
           v-if="filter.type === 'text' || filter.type === 'number'"
           :placeholder="filter.placeholder" 
           :type="filter.type"                
            v-model="filter.property"               //&lt;--- set the property
       &gt;
  </code></pre>
  
  <p>This doesn't work. The v-model just interprets it as a string and not a reference to a form property. 
  I tested other ways, like: <code>v-model="``${[filter.property]}``"</code> (single, not double  ```` but it wont show in stackoverflow otherwise) and other crazy things but it isn't valid.</p>
  
  <p>So how do I set v-model with a variable containing a string (so that it can be set dynamically)?</p>