vue-cli-plugin-electron-builder
vue-cli-plugin-electron-builder copied to clipboard
Initial Route not working in build electron.exe
Describe the bug
The Initial Route is not loaded/shown in the build electron.exe.
I'd like to confirm if this is a bug in this cli or in the electron-builder.
To Reproduce I have setup a very basic project: https://github.com/MBurchard/vue-electron-bug-2022-05-16
- An initial Vue 3 project.
-
vue add electron-builder@alpha
- change
tsconfig.json
, add"useUnknownInCatchVariables": false,
- Test the project with
npm run electron:serve
--> All looks fine - Build the project with
npm run electron:build
- switch to folder
dist_electron\win-unpacked
and start the electron.exe --> Initial Route not loaded... Router works when using the links.
Expected behavior The initial Route should be loaded correctly like in the serve mode.
Screenshots
I faced the same problem and my solution was to use the onMounted
hook in Vue.
Example:
onMounted(() => {
this.$router.push('/');
})
yes, we also have a workaround in place for our application, but it should work without it and it would be nice if this can be fixed.
No support to the alpha release.