Closed robertnicjoo closed 1 year ago
Use api mode, and pass an array with one image: https://codepen.io/mirari/pen/NWpwVdd
Use api mode, and pass an array with one image: https://codepen.io/mirari/pen/NWpwVdd
TypeError: e.map is not a function
<img @click="show(post.media_url)" class="card-img-top" :src="post.media_url" height="150" :alt="post.alt">
show(url) {
this.$viewerApi({
images: url,
options: {
initialViewIndex: 2,
},
});
},
PS: my images are dynamic therefore I cannot have then on data{}
(pre-loaded) like your sample code i must get them on page content instead.
this.$viewerApi({
images: [url],
options: {
navbar: false,
},
});
Thank you, any suggestion on how to remove extra buttons such as play button?
Try this:
this.$viewerApi({
images: [url],
options: {
navbar: false,
toolbar: {
zoomIn: true,
zoomOut: true,
oneToOne: true,
reset: true,
prev: false,
play: false,
next: false,
rotateLeft: true,
rotateRight: true,
flipHorizontal: true,
flipVertical: true,
},
},
})
Amazing, Thanks a lot.
How can I open and image on click (no array of images, just single image)