<template lang="pug">
    .cart-list
        template(v-for="item in items")
            cart-item(:data="item")
</template>

<script>
    import CartItem from '@/components/CartItem'
    import { mapGetters, mapActions } from 'vuex'

    export default {
        components: {
            'cart-item': CartItem
        },
        computed: mapGetters({
            items: 'getCartItems'
        }),
        methods: {
            ...mapActions([
                'addToCart',
                'removeFromCart'
            ])
        }
    }
</script>


<style lang="sass">
    .cart-list
        width: 100%
        height: calc(100% - 100px)
        padding: 10px 0
        overflow-y: auto
</style>

