<template>
  <div id="productEditList">
    <div class="columns is-multiline is-variable is-desktop">
      <div
        class="column is-one-third-desktop"
        v-for="(product, index) in products"
        :key="index"
      >
        <ProductEditCard v-bind:index="index"></ProductEditCard>
      </div>
    </div>
  </div>
</template>

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

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