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

SSR Support #6

Open
samuelgoddard opened this issue Jun 3, 2019 · 6 comments
Open

SSR Support #6

samuelgoddard opened this issue Jun 3, 2019 · 6 comments

Comments

@samuelgoddard
Copy link

Hi mate, really appreciate this port, it's working great on my Vue projects. However, I'm attempting to use this library in a Nuxt project and and stumbling with SSR support. I've noticed this is on your roadmap, do you have any idea when this might get implemented / any guidance to how to approach getting it working so I can potentially look at opening a PR?

Thanks again

@magisters-cc
Copy link
Owner

magisters-cc commented Jun 4, 2019

@samuelgoddard hi! for ssr i want to use smooth scrollbar as directive (for example, like vue-quill-editor https://github.com/surmon-china/vue-quill-editor/blob/master/src/ssr.js). In nuxt i used it with <no-ssr> at this moment. Hope this helps 😊

@DidoMarchet
Copy link

Hi,
sorry but if you use no-ssr it doesn't render (dynamic) content inside the vue-smooth-scrollbar component.
That's mean the app it's not rendered and it remain a spa 😐
Thanks to the support and have a nice day!

@magisters-cc
Copy link
Owner

@DidoMarchet I used it with mixin, that checks spa or ssr mode, and for ssr i render markup without scrollbar, and when spa app mounted, i replace static content with content with scrollbar. This methods works for me, but it still not clean solution 🤔

@scaccogatto
Copy link

Hello there,
I think the general approach is not the ideal one, directives should be used for DOM manipulation.
So, after some thinking, I went for a pure directive implementation: https://github.com/scaccogatto/smooth-vuebar

This guy supports SSR out of the box and it runs smoothly.
Tell me what you think, maybe we can build something better together.

@shiliaev
Copy link

Screenshot 2019-07-28 at 22 38 14

Just use ` { mode: client } `

@Funnyang
Copy link

for render (dynamic) content, It maybe should like this:

<template>
  <div ref="scrollArea" class="smooth-scrollbar">
     <div>
       <slot/>
    </div>
  </div>
</template>

for me, it works

Repository owner deleted a comment Jan 31, 2024
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

6 participants