DEV Community

Discussion on: How to Locomotive Scroll and Nuxt (with example and gotchas)

Collapse
 
luxdamore profile image
Luca Iaconelli

Cool! I've worked with Locomotive/Gsap/Nuxt for the last 2 months.. And sometimes it's not easy to get into the way they work! So, Good Job!! :)

JTK, if this is related to NuxtJs only, you should inject the LocomotiveScroll library in the ​plugin: nuxtjs.org/docs/2.x/directory-stru...

Collapse
 
didomarchet profile image
Davide Marchet • Edited

Hi,
thanks!
Locomotive Scroll is already injected into the plugin.
You can initialize Locomotive Scroll instances
where you want as many times as you want using:
const myLocomotive = new this.LocomotiveScroll({ el, ...options }) where el is your DOM element and options the instance options.
Is this what you were asking!?