title: Vuex v-model to an object state field
body: <p>I have a Vuex state, like this (it also has a getter, named <code>configs</code>:</p>
  
  <pre><code>configs: {
  
      1303401: {
  
          exampleValue: 'test'
  
      }
  
  }
  </code></pre>
  
  <p>I also have an input where I v-model the <code>exampleValue</code> from the Vuex store's state:</p>
  
  <pre><code>&lt;input type="text" v-model="config.exampleValue" /&gt;
  </code></pre>
  
  <p>Here is the computed property I use to return the <code>config</code>:</p>
  
  <pre><code>config: {
  
      get () {
  
          return this.$store.getters.configs[1303401]
  
      },
      set (value) {
  
          //this should set the configs[1303401] field with the updated exampleValue
          this.$store.dispatch('UPDATE_CONFIG', value)
  
      }
  
  
  }
  </code></pre>
  
  <p>The input's value changes to the value of <code>config.exampleValue</code>, so the computed data is not undefined, but the Vuex state does not update.</p>
  
  <p><strong>Also if I try to <code>console.log</code> the value in the setter, nothing appears in the console, so the setter isn't even executed</strong></p>
  
  <p>It is probably because it is not setting the <code>config</code> computed property, but the <code>config.exampleValue</code>, but I have no idea, how to handle that.</p>
  
  <p>As @asi-ple mentioned above, changing the get to return <code>configs[1303401].exampleValue</code> would work, but the problem is, that the config has more fields, and the page has more inputs, and I'd need to create a computed property for all fields this way.</p>