Closed jordanranson closed 6 years ago
Looks like this is a flickity issue
@drewjbartlett this is not a flickity issue. I think what @jordanranson want is to pre-render the DOM server side, but vue-flickity
will instantiate flickity automatically. Which for obvious reasons, should not happen on server side (as the error says, window is not defined
)
It could be a good idea to let user choose if the init method should be called on mounted, or not. Maybe through an extra prop
or an options
, but I think the last is made to match Flickity API.
This option could be called something like ssr
(if true
then do not call init on mounted hook) or autoInit
(if true
call init on mounted hook)
I can make a PR if needed.
https://github.com/metafizzy/flickity/blob/master/js/index.js#L39
I can see here that the plugin call window
a bit early, that might cause an issue as well. So, unfortunately, I see no option for vue-flickity
to resolve this at this point...
When I try to use this component with Vue SSR, I get the following error in the console: