Level 8
Probably something like this:
import PhotoSwipe from "photoswipe";
import PhotoSwipeUI_Default from 'photoswipe/dist/photoswipe-ui-default';
1 like
Hello,
I try to install PhotoSwipe gallery but had JS errors on html page -
"Uncaught ReferenceError: PhotoSwipeUI_Default is not defined"
As I understand it's because not all JS includes correctly.
Can anybody explain how to correctly install PhotoSwipe? It's possible with Mix?
PS: I try to install in this way:
yarn add photoswipe
in bottom of resources/assets/js/bootstrap.js I add
window.PhotoSwipe = require('photoswipe');
npm run dev
you can tell mix from where to where it should copy files (images or what ever):
mix.copy('resources/assets/images', 'public/images');
your images are probably in under node_modules/photoswipe
Please or to participate in this conversation.