<template>
  <div id="productsList">
    <div class="columns is-multiline is-variable is-7-desktop">
      <div
        class="column is-one-quarter"
        v-for="product in products"
        :key="product.id"
      >
        <ProductCard v-bind="product"></ProductCard>
      </div>
    </div>
  </div>
</template>

<script>
import ProductCard from "@/components/ProductCard.vue";

export default {
  name: "ProductsList",
  components: {
    ProductCard
  },
  computed: {
    products() {
      return this.$store.getters.products;
    }
  },
  created() {
    this.$store.dispatch("refreshProducts");
  }
};
</script>
