1234567891011121314151617181920212223242526272829303132333435 |
- <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>
|