Skip to content

Commit

Permalink
[skip ci] docs: show how to use history mode in electron:build
Browse files Browse the repository at this point in the history
  • Loading branch information
nklayman committed Oct 22, 2018
1 parent 5bf4771 commit a7b08ca
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions docs/guide/commonIssues.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@ sidebarDepth: 2

## Blank screen on builds, but works fine on serve

This issue is likely caused when vue-router is operating in `history` mode. Disable history mode like so:
This issue is likely caused when vue-router is operating in `history` mode. To fix this, add a `mounted` hook to the root Vue component:

```javascript
// src/router.js or src/router/index.js
// ...
export default new Router({
mode: 'hash' // instead of "mode: 'history'"
// ...
})
// ...
// src/main.js

new Vue({
router,
render: h => h(App),
mounted() {
// Prevent blank screen in Electron builds
this.$router.push('/')
}
}).$mount('#app')
```

This will fix the Electron build issues, but won't affect web builds.

## `electron:serve` freezes on `Launching Electron...`

Often this issue is caused when Vue Devtools fails to install. This may happen if Vue Devtools cannot be accessed in your location (eg. China). To fix this, you may have to disable Vue Devtools by removing the following lines from your `src/background.(js|ts)` file:
Expand Down

0 comments on commit a7b08ca

Please sign in to comment.