[Update Foto Kategori]
This commit is contained in:
parent
af3e9a44fa
commit
faae07f08c
@ -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-else-if="categories.length > 0" class="mt-12 grid grid-cols-1 md:grid-cols-3 gap-8">
|
||||||
<div
|
<div
|
||||||
v-for="category in categories"
|
v-for="category in categories"
|
||||||
:key="category.id"
|
:key="category.id + '-' + category.foto"
|
||||||
@click="onCategoryClick(category)"
|
@click="onCategoryClick(category)"
|
||||||
class="group cursor-pointer overflow-hidden rounded-lg shadow-lg hover:shadow-2xl transition-all duration-300"
|
class="group cursor-pointer overflow-hidden rounded-lg shadow-lg hover:shadow-2xl transition-all duration-300"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
v-if="category.foto"
|
v-if="category.foto"
|
||||||
:src="category.foto"
|
:src="`http://localhost:8000${category.foto}`"
|
||||||
:alt="category.nama"
|
:alt="category.nama"
|
||||||
class="w-full h-48 object-cover group-hover:scale-110 transition-transform duration-300"
|
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
|
// Panggil saat component mounted
|
||||||
fetchCategories()
|
fetchCategories()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user