0

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

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

有什么办法可以做到这一点?

提前致谢!

4

1 回答 1

1

您应该使用previewCustomNgxGalleryOptions 的属性。

所以代码应该如下所示。

this.galleryOptions = [
  ...,
  {
    previewCustom: () => {
      // To Do: Your custom preview function here.
    }
  },
  ...
];
于 2021-05-16T14:24:50.727 回答