Closed ovsw closed 5 years ago
Just to clarify: only the SSR part isn't working, if I visit the gallery from another page, in production, it works. Just on the initial render (access URL of the gallery page directly) it fails as described above.
Found a fix, (might want to add this in the documentation) - need to wrap the vue-gallery component inside no-ssr tags. Following the example above, it wuld be like this, inside an SFC:
<template>
<section>
<no-ssr>
<gallery
:images="images"
:index="index"
@close="index = null"/>
</no-ssr>
.....
apparently it's not enough to set ssr: false
when importing the plugin, you need to exclude the whole area that's displaying the enlarged images from SSR, otherwise it errors out. SEO won't be hurt since that section doesn't load any real content until user interaction (click on thumbnail) so it wouldn't contain any meaningful content on page load anyway.
Maybe you can help #3
Using nuxt 2, latest version of vue-gallery from NPM,
/plugins/vue-gallery.js:
then
Gallery is operational in dev mode but throws error:
In productiuon mode, after
build
andstart
, gallery no longer operational. On click on gallery item throws error: