VUE 路由器无法与两个 Electron BrowserWindows 一起使用

VUE Router not working with two Electron BrowserWindows

我正在尝试使用带有 vue-router 的同一个 Vue 应用程序创建一个包含两个 BrowserWindows 的应用程序,但路由器无法正常工作。我总是收到第二条路线的错误“Cannot GET /”。

main\index.js

var mainURL = `http://localhost:9080/`
var secondURL = `http://localhost:9080/page2`

function createWindow () {
  mainWindow = new BrowserWindow({
    height: 600,
    width: 800
  })
  mainWindow.loadURL(mainURL)
  mainWindow.on('closed', () => {
    mainWindow = null
  })

  secondWindow = new BrowserWindow({
    height: 600,
    width: 800
  })
  secondWindow.loadURL(secondURL)
  secondWindow.on('closed', () => {
    secondWindow = null
  })
}

app.on('ready', createWindow)

routes.js

export default [
  {
    path: '/',
    name: 'landing-page',
    component: require('components/LandingPageView')
  },
  {
    path: '/page2',
    name: 'landing-page2',
    component: require('components/LandingPageView2')
  },
  {
    path: '*',
    redirect: '/'
  }
]

测试代码:https://github.com/melquic/vue-two-windows.git

打印屏幕错误:

感谢您的帮助! 最好的。

URL 需要 http://localhost:9080/#/page2 才能完成此工作。