ngxgallery预览打开:获取打开的图像索引并取消预览打开



我想通过重写previewOpen((方法打开一个带有图像索引的matdialog:它不应该打开原始(大图像(预览,而是打开一个matdialog(我已经有了它的代码(。

<ngx-gallery (previewOpen)="openPreview(index)" [options]="galleryOptions" [images]="galleryImages" class="ngx-gallery"></ngx-gallery>

我有什么办法做到这一点吗?

提前预订!

您应该使用NgxGalleryOptions的previewCustom属性。

因此,代码应该如下所示。

this.galleryOptions = [
...,
{
previewCustom: () => {
// To Do: Your custom preview function here.
}
},
...
];

最新更新