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

How to disable for mobile devices #7

Open
urbgimtam opened this issue Jan 19, 2022 · 0 comments
Open

How to disable for mobile devices #7

urbgimtam opened this issue Jan 19, 2022 · 0 comments

Comments

@urbgimtam
Copy link

In Nuxt, when using the original SmoothScrollbar as a plugin, I could use @nuxtjs/device to detect if the device was a desktop.
On mounted, if true, I would initialize the SmoothScrollbar only for desktops, as in low-end mobile devices it slows down too much.

I would use this code:

mounted() {
  if (this.$device.isDesktop) {
    this.$Scrollbar.init(document.querySelector('#top'), {
      alwaysShowTracks: true
    })
  }
}

How can I do the same initialization with smooth-vuebar?

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

1 participant