Kyle Larsen
Kyle Larsen

Reputation: 31

Nuxt Static Deployment Click Events Not Working

I'm working on my Portfolio and I deployed my Nuxt app using thenpm run generate command. I am having an issue with my JavaScript events not working until I have navigated to a different page. I have a click event on a button on the home page. This click event will not work when the page first loads, but if I navigate to the about page, and then back the event will work.

Any info on why this is happening?

Upvotes: 2

Views: 1092

Answers (1)

Kyle Larsen
Kyle Larsen

Reputation: 31

Found the answer in case anyone sees this.

In the Nuxt.js config file adding the following snippet works. For some reason without this, the javascript was not loading properly.

generate: {subFolders: true}, router: {base: '/'}

Upvotes: 1

Related Questions