title: How to add new values to an array object using Vuex?
body: <p>I'm new with vuex, and I'm trying to store objects into an array called orders that have place on the store.js file.</p>
  
  <p>I try to store the values from an object (e.g me.title) into an array that is in the store file by clicking on the button that triggers the method(triggerFunction), but I encountered two problems:</p>
  
  <p>1 - On the console log, I observe that the only variable that is updated is state.order.title, the others remain as undefined (e.g orders.calories)</p>
  
  <p>2 - Also, the state.orders array is empty and no value is pushed into state.orders, as programmed in the mutation.</p>
  
  <p>app.vue</p>
  
  <pre><code>&lt;template&gt;
  &lt;p class="genric-btn primary circle text-uppercase" v-on:click="triggerFunction(me.title,me.description,me.price,me.calories)"&gt;add to cart&lt;/p&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  export default {
      data () {
          return {
              me:{
                  title:"Hamburger",
                  description:"Something here",
                  price:"25",
                  calories:"10"
              },
          }
    },
  methods:{
     triggerFunction: function(title,description,price,calories){  
        this.$store.dispatch('triggerFunction',title,description,price,calories)
      },
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>store.js</p>
  
  <pre><code>import Vue from 'vue'
  import Vuex from 'vuex'
  
  Vue.use(Vuex);
  
  export const store = new Vuex.Store({
      state:{
          order:{title:'',description:'',price:0,calories:0,qty:0},
          orders:[],
      },
      mutations:{
          triggerFunction: (state,title,description,price,calories) =&gt; {
              state.order.title = title,
              state.order.description = description,
              state.order.price = price,
              state.order.calories = calories
              state.order.qty = 1
              state.orders.push(state.order)
                          console.log(state.order)
                          console.log(state.orders)
          },
      },
      actions:{
          triggerFunction: (context,title,description,price,calories) =&gt; {
              context.commit('triggerFunction',title,description,price,calories)
          }
      },
  })
  </code></pre>