From 8b9c1221630a61c97dec05b175b7bd8182b13a05 Mon Sep 17 00:00:00 2001 From: Zara Mudassar <zara.1310@hotmail.com> Date: Tue, 26 Apr 2022 12:40:28 +0200 Subject: [PATCH] ItemCard with props --- src/components/ItemCard.vue | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/components/ItemCard.vue diff --git a/src/components/ItemCard.vue b/src/components/ItemCard.vue new file mode 100644 index 0000000..c7b866e --- /dev/null +++ b/src/components/ItemCard.vue @@ -0,0 +1,31 @@ +<template> + <div class="mt-5"> + <div class="w-4/5 rounded bg-gray-200"> + <img + class="w-full" + :src="item.img || require('../assets/default-product.png')" + alt="Item image" + /> + <div class="p-1 m-1"> + <p class="text-gray-700 text-xs font-bold" id="adress"> + {{ item.adresse }} + </p> + <p class="font-bold text-sm" id="title">{{ item.title }}</p> + <p class="text-gray-700 text-xs" id="price">{{ item.price }} kr</p> + </div> + </div> + </div> +</template> + +<script> +export default { + props: { + item: { + img: String, + adresse: String, + title: String, + price: Number, + }, + }, +}; +</script> -- GitLab