123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <template lang="pug">
- .cart-items-wrapper
- transition-group(name="list" tag="ul" class="cart-items")
- cart-item(v-for="item in items" :key="item" :item="item" :symbol="symbol")
- </template>
- <script>
- import CartItem from '@/components/CartItem'
- import { mapGetters, mapActions } from 'vuex'
- export default {
- props: {
- symbol: {
- type: String,
- default: '$'
- }
- },
- components: {
- 'cart-item': CartItem
- },
- computed: mapGetters({
- items: 'getCartItems'
- }),
- methods: mapActions([
- 'addToCart',
- 'removeFromCart'
- ])
- }
- </script>
- <style lang="sass">
- .cart-items-wrapper
- width: 100%
- height: calc(100% - 125px)
- overflow-y: auto
- overflow-x: hidden
- padding: 0
- margin: 15px 0
- .cart-items
- width: 100%
- padding: 0
- margin: 0
- .list-enter-active, .list-leave-active
- transition: all 0.3s
- .list-enter, .list-leave-to
- opacity: 0
- transform: translateX(300px)
- </style>
|