title: How delete an item using vuex?
body: <p>I just started learning vuex and can`t delete item. I can delete item directly in the component.</p>
  
  <pre><code>deleteCar (cars, id) {
          this.$http.delete('http://localhost:3000/cars/' + cars.id)
            .then(() =&gt; {              
                this.cars.splice(id, 1)
            })
        }
  </code></pre>
  
  <p>In vuex i have: </p>
  
  <pre><code>state: {
      car: {},
      cars: []
    },
    mutations: {
      ADD_CAR (state, car) {
        state.car = car
      },
      GET_CARS (state, cars) {
        state.cars = cars
      }
  
    },
    actions: {
      createCar({commit}, car) {
        axios.post('http://localhost:3000/cars', car)
          .then(() =&gt; {
            commit('ADD_CAR', car)
          })
      },
  
      loadCars({commit}) {
        axios.get('http://localhost:3000/cars')
          .then(res =&gt; {
              const cars = res.data
              commit('GET_CARS', cars)
          })
      }
    }
  </code></pre>
  
  <p>Code in component where i wanna delete item: </p>
  
  <pre><code>&lt;div class="card mb-3" v-for="(car, i) in cars" :key="i"&gt;
        &lt;div class="card-header"&gt;
        Cars name: {{ car.carName }}
        &lt;/div&gt;
        &lt;div class="card-body"&gt;
          &lt;h5 class="card-title"&gt;Country: {{ car.country }}&lt;/h5&gt;
          &lt;p class="card-text"&gt;Year of manufacture: {{ car.carYear }}&lt;/p&gt;
          &lt;button class="btn btn-primary mb-5" @click="deleteCar(car, i)"&gt;Delete Car&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I can add car and get cars. But can`t delete</p>