Reputation: 31
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
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