summaryrefslogblamecommitdiff
path: root/iridescence/src/components/CartCheckout.vue
blob: cde78d9843bbc91184e2d7bbb2cdb3ab50729f17 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
          
                         







                                                                  
          

           
 

                






                                                          


                                           

     

         
<template>
  <div id="cartCheckout">
    <div class="buttons has-addons">
      <router-link to="/cart" class="button is-primary is-rounded"
        >🛒</router-link
      >
      <button class="button is-static">x{{ inCart }}</button>
      <button class="button is-static is-rounded">
        {{ cartTotal }}
      </button>
    </div>
  </div>
</template>

<script>
export default {
  name: "CartCheckout",
  computed: {
    inCart() {
      return Object.values(this.$store.state.cart).reduce(
        (acc, cur) => acc + cur,
        0
      );
    },
    cartTotal() {
      return this.$store.getters.cartTotal;
    }
  }
};
</script>