[Update Foto Kategori]

This commit is contained in:
Arief Dwi Wicaksono 2025-09-15 16:06:03 +07:00
parent af3e9a44fa
commit faae07f08c

View File

@ -31,13 +31,13 @@
<div v-else-if="categories.length > 0" class="mt-12 grid grid-cols-1 md:grid-cols-3 gap-8">
<div
v-for="category in categories"
:key="category.id"
:key="category.id + '-' + category.foto"
@click="onCategoryClick(category)"
class="group cursor-pointer overflow-hidden rounded-lg shadow-lg hover:shadow-2xl transition-all duration-300"
>
<img
v-if="category.foto"
:src="category.foto"
:src="`http://localhost:8000${category.foto}`"
:alt="category.nama"
class="w-full h-48 object-cover group-hover:scale-110 transition-transform duration-300"
>
@ -80,6 +80,9 @@ const fetchCategories = async () => {
}
}
onMounted(fetchCategories)
onActivated(fetchCategories)
// Panggil saat component mounted
fetchCategories()