DominikSerafin / vuebar

(🗃️ Archived) Vue 2 directive for custom scrollbar that uses native scroll behavior. Lightweight, performant, customizable and without dependencies. Used successfully in production on https://ggather.com
https://github.serafin.io/vuebar/
MIT License
649 stars 77 forks source link

Not working in Nuxt #62

Closed UltramarineLights closed 5 years ago

UltramarineLights commented 6 years ago

Hi! I'm trying to get vuebar to work in Nuxt but it does not work, I can see all the code is added through the inspector but no result, could it be due to the layout functionality of Nuxt? Thank you

mavrick commented 6 years ago

What is the error and what version of nuxt are you using @UltramarineLights ?

UltramarineLights commented 6 years ago

It does not give an error, it simply doesn't display even if all the code added by the directive is there in the browser inspector. I'm using the latest Nuxt 1 version.

zeknoss commented 6 years ago

Hello @UltramarineLights , In order to make vue-bar work with Nuxt, you need to create a plugin and add it to the configuration, then you're good to go.

Here's how you do it:

  1. Create a vue-bar.js with following content:
    
    import Vue from 'vue';
    import Vuebar from 'vuebar';

Vue.use(Vuebar);


2. Add the plugin to the nuxt.config.js

... / Plugins to load before mounting the App */ plugins: [ ... '~/plugins/vue-bar', ... ], ...


3. Now you can use the plugin normally

Let us know if you have any problems.

Cheers!
DominikSerafin commented 5 years ago

Hi @zeknoss, thanks for providing help on this issue ❤