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 get the simplebar instance in nuxt 3 / vue 3 #683

Open
PeterSeb opened this issue Mar 6, 2024 · 0 comments
Open

How to get the simplebar instance in nuxt 3 / vue 3 #683

PeterSeb opened this issue Mar 6, 2024 · 0 comments
Labels

Comments

@PeterSeb
Copy link

PeterSeb commented Mar 6, 2024

First of all - thanks for the simplebar!

I read through the readme but I can't seem to find what I'm looking for - I need access to the simplebar instance (like when using simplebar in a normal project) when using simplebar as a nuxt 3 / vue 3 component, maybe someone can help me.

I'm using simplebar-vue as follows:

import simplebar from "simplebar-vue";
import "simplebar-vue/dist/simplebar.min.css";

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.component("simplebar", simplebar);
});

in a scrollbar.ts file in /plugins in a nuxt 3 project - this works, as I'm able to use the component as <simplebar></simplebar> and it is working.
But I'd need access to the simplebar instance to check if it's currently visible and to use some onscroll functionality etc. - but so far I haven't been able to find a solution to expose the instance to my project or the window object.

Can you point me in the right direction or help me?

Best regards,
Sebastian

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

No branches or pull requests

1 participant