primevue-mirror/doc/image/TemplateDoc.vue

81 lines
2.8 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
2023-10-25 08:56:59 +00:00
<p>
2024-05-06 10:45:36 +00:00
An eye icon is displayed by default when the image is hovered in preview mode, use the <i>previewicon</i> slot for custom content. In addition, the <i>image</i> and <i>preview</i> slots are available to define the thumbnail and detailed
2023-10-25 08:56:59 +00:00
image respectively.
</p>
2023-02-28 08:29:30 +00:00
</DocSectionText>
<div class="card flex justify-content-center">
2023-05-03 17:56:09 +00:00
<Image alt="Image" preview>
2024-05-06 10:45:36 +00:00
<template #previewicon>
2023-10-25 08:56:59 +00:00
<i class="pi pi-search"></i>
2023-02-28 08:29:30 +00:00
</template>
2023-05-03 17:56:09 +00:00
<template #image>
2023-10-25 08:56:59 +00:00
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria11.jpg" alt="image" width="250" />
2023-05-03 17:56:09 +00:00
</template>
<template #preview="slotProps">
2023-10-25 08:56:59 +00:00
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria11.jpg" alt="preview" :style="slotProps.style" @click="slotProps.onClick" />
2023-05-03 17:56:09 +00:00
</template>
2023-02-28 08:29:30 +00:00
</Image>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
code: {
2023-09-22 12:54:14 +00:00
basic: `
<Image alt="Image" preview>
2024-05-06 10:45:36 +00:00
<template #previewicon>
2023-10-25 08:56:59 +00:00
<i class="pi pi-search"></i>
2023-02-28 08:29:30 +00:00
</template>
2023-05-03 17:56:09 +00:00
<template #image>
2023-10-25 08:56:59 +00:00
<img src="/thumbnail.jpg" alt="image" />
2023-05-03 17:56:09 +00:00
</template>
<template #preview="slotProps">
2023-10-25 08:56:59 +00:00
<img src="/image.jpg" alt="preview" :style="slotProps.style" @click="slotProps.onClick" />
2023-05-03 17:56:09 +00:00
</template>
2023-10-15 09:38:39 +00:00
</Image>
`,
2023-09-22 12:54:14 +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>
2024-05-06 10:45:36 +00:00
<template #previewicon>
2023-10-25 08:56:59 +00:00
<i class="pi pi-search"></i>
2023-02-28 08:29:30 +00:00
</template>
2023-05-03 17:56:09 +00:00
<template #image>
2023-10-25 08:56:59 +00:00
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria11.jpg" alt="image" width="250" />
2023-05-03 17:56:09 +00:00
</template>
<template #preview="slotProps">
2023-10-25 08:56:59 +00:00
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria11.jpg" alt="preview" :style="slotProps.style" @click="slotProps.onClick" />
2023-05-03 17:56:09 +00:00
</template>
2023-02-28 08:29:30 +00:00
</Image>
</div>
2023-10-15 09:38:39 +00:00
</template>
`,
2023-09-22 12:54:14 +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>
2024-05-06 10:45:36 +00:00
<template #previewicon>
2023-10-25 08:56:59 +00:00
<i class="pi pi-search"></i>
2023-02-28 08:29:30 +00:00
</template>
2023-05-03 17:56:09 +00:00
<template #image>
2023-10-25 08:56:59 +00:00
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria11.jpg" alt="image" width="250" />
2023-05-03 17:56:09 +00:00
</template>
<template #preview="slotProps">
2023-10-25 08:56:59 +00:00
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria11.jpg" alt="preview" :style="slotProps.style" @click="slotProps.onClick" />
2023-05-03 17:56:09 +00:00
</template>
2023-02-28 08:29:30 +00:00
</Image>
</div>
2023-10-25 08:56:59 +00:00
</template>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>