summaryrefslogblamecommitdiff
path: root/iridescence/src/views/Cart.vue
blob: f1c369cf05e7fab79204d4f8a1c5c5d70f657fa7 (plain) (tree)
1
2
3


                           















                                                      








                                                      




                                                    




               
<template>
  <div id="cart">
    <div class="container">
      <div v-if="items" class="section">
        <CartItem
          v-for="item in items"
          :key="item[0]"
          v-bind:id="item[0] * 1"
          v-bind:in-cart="item[1]"
        ></CartItem>
      </div>
      <div v-else class="section">
        <div class="content">
          <p>
            There's nothing in your cart.
            <a href="/">Go home to start shopping!</a>
          </p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import CartItem from "@/components/cart/CartItem.vue";

export default {
  name: "Cart",
  computed: {
    items() {
      return Object.entries(this.$store.state.cart);
    }
  },
  components: {
    CartItem
  }
};
</script>