summaryrefslogtreecommitdiff
path: root/iridescence/src/components/CartCheckout.vue
diff options
context:
space:
mode:
Diffstat (limited to 'iridescence/src/components/CartCheckout.vue')
-rw-r--r--iridescence/src/components/CartCheckout.vue25
1 files changed, 17 insertions, 8 deletions
diff --git a/iridescence/src/components/CartCheckout.vue b/iridescence/src/components/CartCheckout.vue
index ec72acf..19ad706 100644
--- a/iridescence/src/components/CartCheckout.vue
+++ b/iridescence/src/components/CartCheckout.vue
@@ -1,15 +1,24 @@
<template>
- <div class="buttons">
- <button class="button">
- Cart (5)
- </button>
- <button class="button is-info">
- Checkout
- </button>
+ <div id="cartCheckout">
+ <div class="buttons">
+ <router-link to="/cart" class="button">Cart ({{ inCart }})</router-link>
+ <router-link to="/checkout" class="button is-primary">
+ Checkout
+ </router-link>
+ </div>
</div>
</template>
+
<script>
export default {
- name: "CartCheckout"
+ name: "CartCheckout",
+ computed: {
+ inCart() {
+ return Object.values(this.$store.state.cart).reduce(
+ (acc, cur) => acc + cur,
+ 0
+ );
+ }
+ }
};
</script>