title: Unkonwn mutation type in vuex
body: <p>I tried to mutate the state in vuex but, it always says <code>vuex.esm-browser.js?5502:976 [vuex] unknown mutation type: addToCart</code>. I called addToCart in mutation in two different ways as follows, but it is not working. It always throws the same error.</p>
  <pre><code>&lt;button @click=&quot;addToCart(product)&quot; class=&quot;add&quot;&gt;Add&lt;/button&gt;
  </code></pre>
  <pre><code>import {mapMutations} from 'vuex'
      export default{
          methods:{
              ...mapMutations([&quot;addToCart&quot;]),
          },
          props: [&quot;product&quot;],
      }
  &lt;/script&gt;
  </code></pre>
  <pre><code>Vuex store
  </code></pre>
  <pre><code>import { createStore } from &quot;vuex&quot;;
  
  export default createStore({
      state:{
          cart: []
      },
      mutation:{
          addToCart(state, product){
              let item = state.cart.find(i=&gt;i.id === product.id)
  
              if(item){
                  item.quantity++
              }else{
                  state.cart.push({...product, quantity: 1})
              }
          }
      }
  })
  </code></pre>
  <pre><code>I even tried this also
  </code></pre>
  <pre><code>&lt;button @click=&quot;addToCart()&quot; class=&quot;add&quot;&gt;Add&lt;/button&gt;
  
  &lt;script&gt;
     props: [&quot;product&quot;],
     methods:{
          addToCart(){
          this.$store.commit('addToCart', this.product)
       }
     }
  &lt;/script&gt;
  </code></pre>