DEV Community

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

Collapse
 
jpcarpenter profile image
Jacob Carpenter

Thank you, thank you, thank you! I've tried to implement Locomotive Scroll in two other nuxt projects and ended up dumping it because of various errors I couldn't get past. This seems pretty straight forward. Can't wait to give it a try.

Collapse
 
didomarchet profile image
Davide Marchet

Hi, thanks! Let me know !

Collapse
 
jpcarpenter profile image
Jacob Carpenter

Unfortunately I get the same results as all the other times I've attempted to use this library. (mentioned in this issue: github.com/locomotivemtl/locomotiv...). Based on my days of searching for solutions, It seems like vue based web apps have these types of problems, that unfortunately no one has posted solutions to. ¯_(ツ)_/¯

Thread Thread
 
didomarchet profile image
Davide Marchet • Edited

Are you loading contents after the mounted hook?

Thread Thread
 
jpcarpenter profile image
Jacob Carpenter

I was fetching the content via asyncData in a page, then was calling this.$nuxt.$emit('update-locomotive') inside the mounted hook on the page to attempt to update the locomotive instance. I've tried this method of updating the instance before, and have never had any luck unfortunately. The issue is that the footer, and a few sections above the footer, are always hidden, or there is a huge amount of whitespace under the footer.

Thread Thread
 
didomarchet profile image
Davide Marchet

Hi, If you want, share with me a simplified version of the implementation of the starter-kit and the code with the problem.
I'll check as soon as I have a moment. Have a nice day!