From 942a9140f06554548225c60d59fdb5709b7987b8 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Tue, 21 Jul 2020 12:59:46 +0200 Subject: [PATCH] New product page with defined route and link from productCard. --- frontend/components/Product.vue | 140 +++++++++++++++++++++++++ frontend/components/ui/ProductCard.vue | 8 +- frontend/routes.js | 5 + 3 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 frontend/components/Product.vue diff --git a/frontend/components/Product.vue b/frontend/components/Product.vue new file mode 100644 index 0000000..02c3193 --- /dev/null +++ b/frontend/components/Product.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/frontend/components/ui/ProductCard.vue b/frontend/components/ui/ProductCard.vue index 7f2566e..cb062a0 100644 --- a/frontend/components/ui/ProductCard.vue +++ b/frontend/components/ui/ProductCard.vue @@ -22,6 +22,7 @@
+
@@ -61,13 +62,16 @@ export default { methods: { addItemToCart() { store.dispatch('cartModule/addItemToCart', { ...this.product }); + }, + viewProduct() { + this.$router.push('/shop/' + this.product.urlSlug) } } }