primevue-mirror/doc/image/TemplateDoc.vue

72 lines
2.8 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>An eye icon is displayed by default when the image is hovered in preview mode. Use the <i>indicator</i> slot for custom content.</p>
</DocSectionText>
<div class="card flex justify-content-center">
2023-05-03 17:56:09 +00:00
<Image alt="Image" preview>
2023-05-02 07:27:03 +00:00
<template #indicatoricon>
2023-02-28 08:29:30 +00:00
<i class="pi pi-check"></i>
</template>
2023-05-03 17:56:09 +00:00
<template #image>
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria12s.jpg" alt="image" />
</template>
<template #preview="slotProps">
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria12.jpg" alt="preview" :style="slotProps.style" @click="slotProps.onClick" />
</template>
2023-02-28 08:29:30 +00:00
</Image>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
code: {
2023-08-16 13:58:31 +00:00
basic: `<Image alt="Image" preview>
2023-05-01 15:42:39 +00:00
<template #indicatoricon>
2023-02-28 08:29:30 +00:00
<i class="pi pi-check"></i>
</template>
2023-05-03 17:56:09 +00:00
<template #image>
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria12s.jpg" alt="image" />
</template>
<template #preview="slotProps">
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria12.jpg" alt="preview" :style="slotProps.style" @click="slotProps.onClick" />
</template>
2023-02-28 08:29:30 +00:00
</Image>`,
2023-08-16 13:58:31 +00:00
options: `<template>
2023-02-28 08:29:30 +00:00
<div class="card flex justify-content-center">
2023-05-03 17:56:09 +00:00
<Image alt="Image" preview>
2023-05-02 07:27:03 +00:00
<template #indicatoricon>
2023-02-28 08:29:30 +00:00
<i class="pi pi-check"></i>
</template>
2023-05-03 17:56:09 +00:00
<template #image>
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria12s.jpg" alt="image" />
</template>
<template #preview="slotProps">
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria12.jpg" alt="preview" :style="slotProps.style" @click="slotProps.onClick" />
</template>
2023-02-28 08:29:30 +00:00
</Image>
</div>
</template>`,
2023-08-16 13:58:31 +00:00
composition: `<template>
2023-02-28 08:29:30 +00:00
<div class="card flex justify-content-center">
2023-05-03 17:56:09 +00:00
<Image alt="Image" preview>
2023-05-02 07:27:03 +00:00
<template #indicatoricon>
2023-02-28 08:29:30 +00:00
<i class="pi pi-check"></i>
</template>
2023-05-03 17:56:09 +00:00
<template #image>
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria12s.jpg" alt="image" />
</template>
<template #preview="slotProps">
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria12.jpg" alt="preview" :style="slotProps.style" @click="slotProps.onClick" />
</template>
2023-02-28 08:29:30 +00:00
</Image>
</div>
</template>`
}
};
}
};
</script>