zfan93
02/17/2023, 6:21 AM// Include Lightbox
import PhotoSwipeLightbox from '/photoswipe/photoswipe-lightbox.esm.js';
const lightbox = new PhotoSwipeLightbox({
// may select multiple "galleries"
gallery: '#gallery--getting-started',
// Elements within gallery (slides)
children: 'a',
// setup PhotoSwipe Core dynamic import
pswpModule: () => import('/photoswipe/photoswipe.esm.js')
});
lightbox.init();
How do I define it in kotlin with @JsModule("") ?This seems a lot more complicated than the example on the website....Many thanks!!🫡zfan93
02/17/2023, 6:31 AM@JsModule("photoswipe/lightbox")
external class PhotoSwipeLightbox(){
fun init()
}
val lightbox =PhotoSwipeLightbox()
lightbox.init()
David Herman
02/17/2023, 6:33 AMDavid Herman
02/17/2023, 6:35 AMzfan93
02/17/2023, 6:36 AM@file:JsModule("extModule")
package ext.jspackage.name
external fun foo()
external class C
David Herman
02/17/2023, 6:39 AMDavid Herman
02/17/2023, 6:40 AM@file:JsNonModule
because 🤷 I don't know why, the compiler said I had to 🙂zfan93
02/17/2023, 8:53 AMBig Chungus
02/17/2023, 9:29 AMDavid Herman
02/17/2023, 5:56 PM