ProductsGrid.vue 1016 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template lang="pug">
  2. .products-grid
  3. product-card(v-for="product in products" :key="product" :item="product" :symbol="symbol")
  4. product-selector
  5. </template>
  6. <script>
  7. import ProductCard from '@/components/ProductCard'
  8. import ProductSelector from '@/components/ProductSelector'
  9. import { mapGetters, mapActions } from 'vuex'
  10. export default {
  11. props: {
  12. symbol: {
  13. type: String,
  14. default: '$',
  15. required: true
  16. }
  17. },
  18. components: {
  19. 'product-card': ProductCard,
  20. 'product-selector': ProductSelector
  21. },
  22. computed: mapGetters({
  23. products: 'getProducts',
  24. hasSelectedProduct: 'hasSelectedProduct'
  25. }),
  26. methods: mapActions([
  27. 'selectProduct'
  28. ])
  29. }
  30. </script>
  31. <style lang="sass">
  32. .products-grid
  33. width: 100%
  34. // height: 100%
  35. padding-top: 15px
  36. overflow-y: auto
  37. </style>