2023-02-28 08:29:30 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
|
|
|
<p>A slideshow implementation is defined by adding <i>circular</i> and <i>autoPlay</i> properties.</p>
|
|
|
|
</DocSectionText>
|
|
|
|
<div class="card md:flex md:justify-content-center">
|
|
|
|
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" containerStyle="max-width: 640px" :circular="true" :autoPlay="true" :transitionInterval="2000">
|
|
|
|
<template #item="slotProps">
|
|
|
|
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block" />
|
|
|
|
</template>
|
|
|
|
<template #thumbnail="slotProps">
|
|
|
|
<img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block" />
|
|
|
|
</template>
|
|
|
|
</Galleria>
|
|
|
|
</div>
|
|
|
|
<DocSectionCode :code="code" :service="['PhotoService']" />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { PhotoService } from '@/service/PhotoService';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
images: null,
|
|
|
|
responsiveOptions: [
|
|
|
|
{
|
|
|
|
breakpoint: '991px',
|
|
|
|
numVisible: 4
|
|
|
|
},
|
|
|
|
{
|
|
|
|
breakpoint: '767px',
|
|
|
|
numVisible: 3
|
|
|
|
},
|
|
|
|
{
|
|
|
|
breakpoint: '575px',
|
|
|
|
numVisible: 1
|
|
|
|
}
|
|
|
|
],
|
|
|
|
code: {
|
2023-09-22 12:54:14 +00:00
|
|
|
basic: `
|
|
|
|
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" containerStyle="max-width: 640px"
|
2023-02-28 08:29:30 +00:00
|
|
|
:circular="true" :autoPlay="true" :transitionInterval="2000">
|
|
|
|
<template #item="slotProps">
|
|
|
|
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block" />
|
|
|
|
</template>
|
|
|
|
<template #thumbnail="slotProps">
|
|
|
|
<img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block" />
|
|
|
|
</template>
|
|
|
|
</Galleria>`,
|
2023-09-22 12:54:14 +00:00
|
|
|
options: `
|
|
|
|
<template>
|
2023-02-28 08:29:30 +00:00
|
|
|
<div class="card md:flex md:justify-content-center">
|
|
|
|
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" containerStyle="max-width: 640px"
|
|
|
|
:circular="true" :autoPlay="true" :transitionInterval="2000">
|
|
|
|
<template #item="slotProps">
|
|
|
|
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block" />
|
|
|
|
</template>
|
|
|
|
<template #thumbnail="slotProps">
|
|
|
|
<img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block" />
|
|
|
|
</template>
|
|
|
|
</Galleria>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { PhotoService } from '@/service/PhotoService';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
images: null,
|
|
|
|
responsiveOptions: [
|
|
|
|
{
|
|
|
|
breakpoint: '991px',
|
|
|
|
numVisible: 4
|
|
|
|
},
|
|
|
|
{
|
|
|
|
breakpoint: '767px',
|
|
|
|
numVisible: 3
|
|
|
|
},
|
|
|
|
{
|
|
|
|
breakpoint: '575px',
|
|
|
|
numVisible: 1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
PhotoService.getImages().then((data) => (this.images = data));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
<\/script>`,
|
2023-09-22 12:54:14 +00:00
|
|
|
composition: `
|
|
|
|
<template>
|
2023-02-28 08:29:30 +00:00
|
|
|
<div class="card md:flex md:justify-content-center">
|
|
|
|
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" containerStyle="max-width: 640px"
|
|
|
|
:circular="true" :autoPlay="true" :transitionInterval="2000">
|
|
|
|
<template #item="slotProps">
|
|
|
|
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block" />
|
|
|
|
</template>
|
|
|
|
<template #thumbnail="slotProps">
|
|
|
|
<img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block" />
|
|
|
|
</template>
|
|
|
|
</Galleria>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref, onMounted } from "vue";
|
|
|
|
import { PhotoService } from '@/service/PhotoService';
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
PhotoService.getImages().then((data) => (images.value = data));
|
|
|
|
});
|
|
|
|
|
|
|
|
const images = ref();
|
|
|
|
const responsiveOptions = ref([
|
|
|
|
{
|
|
|
|
breakpoint: '991px',
|
|
|
|
numVisible: 4
|
|
|
|
},
|
|
|
|
{
|
|
|
|
breakpoint: '767px',
|
|
|
|
numVisible: 3
|
|
|
|
},
|
|
|
|
{
|
|
|
|
breakpoint: '575px',
|
|
|
|
numVisible: 1
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
<\/script>`,
|
|
|
|
data: `
|
|
|
|
/* PhotoService */
|
|
|
|
{
|
|
|
|
itemImageSrc: 'https://primefaces.org/cdn/primevue/images/galleria/galleria1.jpg',
|
|
|
|
thumbnailImageSrc: 'https://primefaces.org/cdn/primevue/images/galleria/galleria1s.jpg',
|
|
|
|
alt: 'Description for Image 1',
|
|
|
|
title: 'Title 1'
|
|
|
|
},
|
|
|
|
...
|
|
|
|
`
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
PhotoService.getImages().then((data) => (this.images = data));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|