From fb5eb06bdd7f7a36a73a6f844006bc66c1b545e1 Mon Sep 17 00:00:00 2001 From: Mateja Date: Sat, 24 Jul 2021 20:19:10 +0200 Subject: Fetch products inside Vuex and display them using `ProductCard` components. --- client/src/components/ProductCard.vue | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'client/src/components') diff --git a/client/src/components/ProductCard.vue b/client/src/components/ProductCard.vue index 57698e5..849c360 100644 --- a/client/src/components/ProductCard.vue +++ b/client/src/components/ProductCard.vue @@ -1,9 +1,10 @@ @@ -12,9 +13,18 @@ export default { name: 'ProductCard', props: { - productName: String, - productImg: String, - productLink: String + Id: String, + Name: String, + Img: String, + Price: Number + }, + computed: { + ImgLink() { + return `${process.env.VUE_APP_ROOT_API}/${this.Img}`; + }, + ProductLink() { + return `/product/${this.Id}` + } } } -- cgit v1.2.3