CartItems.vue 963 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template lang="pug">
  2. .cart-items-wrapper
  3. transition-group(name="list" tag="ul" class="cart-items")
  4. cart-item(v-for="item in cartItems" :key="item" :item="item")
  5. </template>
  6. <script>
  7. import CartItem from '@/components/cart/CartItem'
  8. import { mapGetters, mapActions } from 'vuex'
  9. export default {
  10. components: {
  11. CartItem
  12. },
  13. computed: mapGetters([
  14. 'cartItems'
  15. ]),
  16. methods: mapActions([
  17. 'addToCart',
  18. 'removeFromCart'
  19. ])
  20. }
  21. </script>
  22. <style lang="sass">
  23. .cart-items-wrapper
  24. width: 100%
  25. height: calc(100% - 100px)
  26. overflow-y: auto
  27. overflow-x: hidden
  28. .cart-items
  29. width: 100%
  30. padding: 0
  31. margin: 0
  32. .list-enter-active, .list-leave-active
  33. transition: all 0.3s
  34. .list-enter, .list-leave-to
  35. opacity: 0
  36. transform: translateX(300px)
  37. </style>