ProductsGrid.vue 752 B

12345678910111213141516171819202122232425262728293031323334
  1. <template lang="pug">
  2. .products-grid
  3. template(v-for="product in products")
  4. product-card(:data="product")
  5. </template>
  6. <script>
  7. import ProductCard from '@/components/ProductCard'
  8. import { mapGetters, mapActions } from 'vuex'
  9. export default {
  10. components: {
  11. 'product-card': ProductCard
  12. },
  13. computed: mapGetters({
  14. products: 'getProducts'
  15. }),
  16. methods: mapActions([
  17. 'fetchProducts',
  18. 'selectProduct'
  19. ]),
  20. mounted() {
  21. this.fetchProducts()
  22. }
  23. }
  24. </script>
  25. <style lang="sass">
  26. .products-grid
  27. width: 100%
  28. // height: 100%
  29. padding-top: 15px
  30. overflow-y: auto
  31. </style>