electron-vue-router-url
Install
npm i electron-vue-router-url --save
Usage
First of all, you need to disable mode: 'history'
in your vue-router, check in vue-router docs
Then do the following:
src/main/index.js example:
const getVueUrl = ; ipc { win = width: 800 height: 600 webPreferences: // this is important! nodeIntegration: true ; // loads process.env.WEBPACK_DEV_SERVER_URL + #/` or `app://./index.html#/` when build win; win;}
In your router, use the exact path to your url
src/renderer/router.js example
path: '/showChart' name: 'showChart' component:
nodeIntegration
must be set to true
(nodeIntegration
was true
by default in previous electron versions, but false by default in 5.0.0.)
Author
👤 3zbumban
- Github: @3zbumban
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2019 3zbumban.
This project is BSD-3-Clause licensed.
This README was generated with ❤️ by readme-md-generator