aboutsummaryrefslogtreecommitdiff
path: root/client/src/views/Home.vue
blob: a71d2cbfdf4942fe9a7f1fa6c5db6ec7d4efc51f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<template>
  <div class="row mt-5">
    <div v-for="product in products" :key="product._id" class="col-lg-3 col-md-4 col-sm-6">
      <ProductCard :Id="product._id" :Name="product.name" :Price="product.price" :Img="product.imagePath"/>
    </div>
  </div>
</template>

<script>
import ProductCard from '@/components/ProductCard';

export default {
  name: 'Home',
  components: {
    ProductCard
  },
  mounted() {
    this.$store.dispatch('pullProducts');
  },
  computed: {
    products() {
      return this.$store.getters.getProducts;
    }
  }
}
</script>