title: How to commit received data to Vue store?
body: <p>I'm trying to:</p>
  
  <ul>
  <li><p>get element's data <code>@click</code> using <code>getDetails</code> method and put it into <code>fileProperties: []</code></p></li>
  <li><p>and then send that data to store using <code>fileDetails</code> computed property</p></li>
  </ul>
  
  <p>This worked for my other components which have <code>v-model</code> and simple true/false state, but I'm not sure how to send the created by the method array of data to the store properly. </p>
  
  <p>In other words, how do I make this computed property to get the data from <code>fileProperties: []</code> and commit it to store? The <code>fileDetails</code> computed property below is not committing anything.</p>
  
  <h2>Code:</h2>
  
    
  
  <pre class="lang-html prettyprint-override"><code>  [...]
  
    &lt;div @click="getDetails(file)"&gt;&lt;/div&gt;
  
    [...]
  
  
  &lt;script&gt;
    export default {
      name: 'files',
      data () {
        return {
          fileProperties: []
        }
      },
      props: {
        file: Object
      },
      methods: {
        getDetails (value) {
          this.fileProperties = [{"extension": path.extname(value.path)}, 
                                {"size": this.$options.filters.prettySize(value.stat.size)}]
        }
      },
      computed: {
        isFile () {
          return this.file.stat.isFile()
        },
        fileDetails: {
          get () {
            return this.$store.state.Settings.fileDetails
          },
          set (value) {
            this.$store.commit('loadFileDetails', this.fileProperties)
          }     
        }
      }
    }
  &lt;/script&gt;
  </code></pre>
  
  <h2>store module:</h2>
  
  <pre class="lang-html prettyprint-override"><code>const state = {
      fileDetails: []
  }
  
  const mutations = {
      loadFileDetails (state, fileDetails) {
          state.fileDetails = fileDetails
      }
  }
  </code></pre>
  
  <h2>Example on codepen:</h2>
  
  <p><a href="https://codepen.io/anon/pen/qxjdNo?editors=1011" rel="nofollow noreferrer">https://codepen.io/anon/pen/qxjdNo?editors=1011</a></p>
  
  <p>In this codepen example, how can I send over the dummy data <code>[ { "1": 1 }, { "2": 2 } ]</code> to the store on button click? </p>