From 471d0bdb54fd6298d4a35b81ef3cd9f240343bff Mon Sep 17 00:00:00 2001 From: marzban-dev Date: Mon, 21 Apr 2025 21:15:20 +0330 Subject: [PATCH] Add limit for product card colors --- .../components/global/product/ProductCard.vue | 45 ++++++++----------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/frontend/components/global/product/ProductCard.vue b/frontend/components/global/product/ProductCard.vue index 745cdb8..f96e0dc 100644 --- a/frontend/components/global/product/ProductCard.vue +++ b/frontend/components/global/product/ProductCard.vue @@ -22,11 +22,17 @@ type Props = { // props const props = defineProps(); -const { id } = toRefs(props); +const { id, colors } = toRefs(props); // state const { colorObject } = useImageColor(`#product-image-${id.value}`); + +// computed + +const limitedColors = computed(() => { + return colors.value.slice(0, 3); +});