aboutsummaryrefslogtreecommitdiff
path: root/client/src
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-07-26 15:04:35 +0200
committerMateja <mail@matejamaric.com>2021-07-26 15:04:35 +0200
commit897e274905d372ddee3fcabe15ee855c1b4b60ef (patch)
tree614e4ffb8f6afd3f93c6dd41636590151523bfcf /client/src
parent4bcebc41e72f4f84859adbdb9eff95f9917cf230 (diff)
downloadmevn-ecommerce-897e274905d372ddee3fcabe15ee855c1b4b60ef.tar.gz
mevn-ecommerce-897e274905d372ddee3fcabe15ee855c1b4b60ef.zip
Add back button to product page.
Diffstat (limited to 'client/src')
-rw-r--r--client/src/views/Product.vue6
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/views/Product.vue b/client/src/views/Product.vue
index d1fde29..142fb42 100644
--- a/client/src/views/Product.vue
+++ b/client/src/views/Product.vue
@@ -14,9 +14,10 @@
<p class="card-text" v-text="curProduct.description"></p>
<p class="card-text"><small class="text-muted">Amount: {{curProductQuantity}}</small></p>
</div>
- <div class="card-footer">
+ <div class="card-footer d-flex align-items-baseline">
<div class="btn btn-dark" @click="buy">Add to cart</div>
<div class="btn btn-secondary ms-3" v-show="curProductQuantity" @click="remove">Remove from cart</div>
+ <div class="btn btn-outline-secondary btn-sm ms-auto" @click="back">Go back</div>
</div>
</div>
@@ -48,6 +49,9 @@ export default {
},
remove() {
this.$store.commit('removeFromCart', this.$route.params.id);
+ },
+ back() {
+ this.$router.back();
}
}
}