SimulatedGREG / electron-vue

An Electron & Vue.js quick start boilerplate with vue-cli scaffolding, common Vue plugins, electron-packager/electron-builder, unit/e2e testing, vue-devtools, and webpack.
https://simulatedgreg.gitbooks.io/electron-vue/content/
MIT License
15.48k stars 1.55k forks source link

this.$router.push providing blank page #1014

Open luckie12 opened 4 years ago

luckie12 commented 4 years ago

Describe the issue / bug.

Using this.$router.push('/home') sends me to an empty web page. I have it so when someone logs in, whenever its OK it pushes to home, but it returns a blank page and devtools crashes, (disconnects).

In my CMD it keeps spamming

[16932:0512/134958.917:ERROR:CONSOLE(131)] "Extension server error: Object not found: <top>", source: devtools://devtools/bundled/extensions/ExtensionServer.js (131)

Weird thing is, when i put the this.$router.push inside a mounted() or any other lifecycle hooks, it works normally, but when i use it in a function upon button click, it just 💩 out

this is my router config

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login-page',
      component: require('@/components/LoginPage').default
    },
    {
      path: '*',
      redirect: '/'
    },
    {
      path: '/home',
      name: 'home-page',
      component: require('@/components/HomePage').default
    }
  ]
})
How can I reproduce this problem?
If visual, provide a screenshot.

image

Tell me about your development environment.