On my builds I can route through the router-links to each component but not through the Menu click() events.
From the menu template, I try to change the route by using:
win!.loadURL(“http://localhost:8080/login”), for ex.,
but it simply goes blank (for any URL) when running the build.
Also, if I import the router and try to use route.push(), at the main process, it ends up in a lot of errors, and also doesn’t work.
If I use electron:serve, through, instead of running the build, it works fine. Although it reloads the page from the Menu, differently from the router-links, through which it keeps at the same page and simply changes the route component. I need a build that changes the route view both from the Menu as from the router-links.
So, how can I change the route of my SPA from the Electron Menu and make it run on a final build as it kind of works when running the dev project when calling electron:serve ?
I guess the info that only the “hash” router mode would work is outdated. I’m using the “history” mode and it works with other apps and with this one. The router links all work fine, including at the build. What doesn’t work here is the route change from the Menu - through the win!.loadURL() method.
How should I change the Vue route by using an Electron Menu click() event ?