Browse Source

[FIX] clear selected product

Gogs 7 years ago
parent
commit
14fa4541a0
3 changed files with 4 additions and 5 deletions
  1. 0 1
      src/components/ProductsGrid.vue
  2. 3 3
      src/store/modules/cart.js
  3. 1 1
      src/store/modules/products.js

+ 0 - 1
src/components/ProductsGrid.vue

@@ -2,7 +2,6 @@
     .products-grid
         product-card(v-for="product in products" :key="product" :item="product" :symbol="symbol")
         product-selector
-
 </template>
 
 <script>

+ 3 - 3
src/store/modules/cart.js

@@ -41,9 +41,9 @@ const actions = {
         commit('addToCart', payload)
         commit('calculateTotal')
 
-        dispatch('setSelectedProduct', {
-            product: null
-        })
+        // dispatch('setSelectedProduct', {
+        //     product: null
+        // })
     }
 }
 

+ 1 - 1
src/store/modules/products.js

@@ -6,7 +6,7 @@ const state = {
 }
 
 const getters = {
-    getProducts (state) {
+    getProducts(state) {
         return state.filteredProducts.length === 0 ? state.products : state.filteredProducts
     },
     getSelectedProduct(state) {