TKO/services/frontend/pages/galerie.vue

58 lines
1.3 KiB
Vue
Raw Normal View History

2025-02-09 22:09:39 +01:00
<template>
2025-02-16 14:20:40 +01:00
<h1>Galerie</h1>
<v-row>
<v-col
2025-03-12 16:27:23 +01:00
v-for="(photo, index) in gallery"
2025-02-16 14:20:40 +01:00
:key="index"
cols="4"
style="padding: 0;"
>
<v-img
2025-03-12 16:27:23 +01:00
:lazy-src="photo.image"
:src="photo.image"
2025-02-16 14:20:40 +01:00
aspect-ratio="1"
cover
2025-03-12 16:27:23 +01:00
@click="showCarousel = true"
2025-02-16 14:20:40 +01:00
>
<template v-slot:placeholder>
<v-row>
<v-progress-circular
color="grey-lighten-5"
indeterminate
></v-progress-circular>
</v-row>
</template>
2025-03-12 16:27:23 +01:00
<v-dialog v-model="showCarousel">
<dialog-carousel
:image="photo.image"
:images="gallery"
:title="photo.title"
@isActive="showCarousel = false"
/>
</v-dialog>
2025-02-16 14:20:40 +01:00
</v-img>
</v-col>
</v-row>
2025-02-09 22:09:39 +01:00
</template>
<script setup lang="ts">
2025-02-16 14:20:40 +01:00
import './assets/css/main.css'
2025-03-12 16:27:23 +01:00
import { useAPI } from "~/composables/useAPI";
2025-02-09 22:09:39 +01:00
2025-03-12 16:27:23 +01:00
const showCarousel = ref(false);
interface ArticleImage {
image: string;
title: string;
}
const gallery = ref<ArticleImage[]>([]);
const { error, data } = await useAPI<ArticleImage[]>('load-gallery/', {method: "GET"});
if ( data.value ){
gallery.value = data.value as ArticleImage[];
}
else if (error.value) {
console.error("Error loading gallery:", error.value);
}
2025-02-16 14:20:40 +01:00
</script>