aboutsummaryrefslogtreecommitdiff
path: root/client/src/views/Home.vue
blob: f93042db956b259df22663c26eb7e12382c010c5 (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 d-flex justify-content-center">
    <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>