Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nuxtjs support #2

Closed
dad2cl3 opened this issue Jun 10, 2019 · 5 comments
Closed

nuxtjs support #2

dad2cl3 opened this issue Jun 10, 2019 · 5 comments

Comments

@dad2cl3
Copy link

dad2cl3 commented Jun 10, 2019

Phenomenal repo that fits perfectly with a project i'm working on so thank you! Any chance you might be willing to add support for nuxtjs?

Thanks,

Jason

@ts1
Copy link
Owner

ts1 commented Jun 11, 2019

I'm not familiar with nuxt.js but, I think this can not be SSR'd because it deeply depends on runtime only features like viewport size, image size, etc.
Could it work if you configure this component used client side only?

@dad2cl3
Copy link
Author

dad2cl3 commented Jun 11, 2019

Great suggestion. I’ll definitely give it a shot!

@ts1 ts1 closed this as completed in 681d13c Jun 14, 2019
@dad2cl3
Copy link
Author

dad2cl3 commented Jul 20, 2019

Wanted to check back in to say I finally had an opportunity to work on getting the component working on the client side only and so far so good.

First create a plugin for nuxt named flipbook.js with the following code:
import Vue from 'vue'
import Flipbook from 'flipbook-vue'
Vue.component('Flipbook', Flipbook)

Then register the component within the plugins section of nuxt.config.js with the following code:
{ src: '@/plugins/flipbook', mode: 'client' }

From there, add the component to a Vue file using <Flipbook class="book"...></Flipbook>

Again, amazing library and exactly what I was looking for to complete my project.

Thanks again,

Jason

@piotrbekas
Copy link

From there, add the component to a Vue file using <Flipbook class="book"...></Flipbook>

I found, that when using nuxt generate the <client-only> tag helps.

So you could use it like this:

<client-only>
  <Flipbook class="book"...></Flipbook>
</client-only>

@kissu
Copy link

kissu commented May 8, 2024

I found a working solution for Nuxt3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants