primevue-mirror/doc/galleria/indicator/ClickEventDoc.vue

99 lines
2.9 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Indicators are displayed at the bottom by enabling <i>showIndicators</i> property and interacted with the click event by default.</p>
</DocSectionText>
2023-10-04 09:32:01 +00:00
<div class="card">
2023-10-26 18:39:49 +00:00
<Galleria :value="images" :numVisible="5" containerStyle="max-width: 640px" :showThumbnails="false" :showIndicators="true">
2023-02-28 08:29:30 +00:00
<template #item="slotProps">
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block" />
</template>
</Galleria>
</div>
<DocSectionCode :code="code" :service="['PhotoService']" />
</template>
<script>
import { PhotoService } from '@/service/PhotoService';
export default {
data() {
return {
images: null,
code: {
2023-09-22 12:54:14 +00:00
basic: `
2023-10-26 18:39:49 +00:00
<Galleria :value="images" :numVisible="5" containerStyle="max-width: 640px"
2023-02-28 08:29:30 +00:00
:showThumbnails="false" :showIndicators="true">
<template #item="slotProps">
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block" />
</template>
2023-10-15 09:38:39 +00:00
</Galleria>
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-10-04 09:32:01 +00:00
<div class="card">
2023-10-26 18:39:49 +00:00
<Galleria :value="images" :numVisible="5" containerStyle="max-width: 640px"
2023-02-28 08:29:30 +00:00
:showThumbnails="false" :showIndicators="true">
<template #item="slotProps">
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block" />
</template>
</Galleria>
</div>
</template>
<script>
import { PhotoService } from '@/service/PhotoService';
export default {
data() {
return {
2023-10-26 18:39:49 +00:00
images: null
2023-02-28 08:29:30 +00:00
};
},
mounted() {
PhotoService.getImages().then((data) => (this.images = data));
}
};
2023-10-15 09:38:39 +00:00
<\/script>
`,
2023-09-22 12:54:14 +00:00
composition: `
<template>
2023-10-04 09:32:01 +00:00
<div class="card">
2023-10-26 18:39:49 +00:00
<Galleria :value="images" :numVisible="5" containerStyle="max-width: 640px"
2023-02-28 08:29:30 +00:00
:showThumbnails="false" :showIndicators="true">
<template #item="slotProps">
<img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%; 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();
2023-10-15 09:38:39 +00:00
<\/script>
`,
2023-02-28 08:29:30 +00:00
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>