State Valentin Posted January 15, 2019 Share Posted January 15, 2019 Can someone please show me an example of a CEF Web Application where it uses Vue.js router, please ? I've tried but i can't manage to make it work. Link to comment Share on other sites More sharing options...
MarkCavalli Posted January 15, 2019 Share Posted January 15, 2019 https://github.com/MarkCavalli/rage-server-start-template 1 Link to comment Share on other sites More sharing options...
State Valentin Posted January 17, 2019 Author Share Posted January 17, 2019 (edited) Thanks @MarkCavalli for the project. In the end i've ended up using: Vue Cli 3 (https://cli.vuejs.org/) + Vue Js Store. Edited January 17, 2019 by State Valentin Link to comment Share on other sites More sharing options...
deadnuts143 Posted July 6, 2019 Share Posted July 6, 2019 A bit late, but someone else might need this. 🤔 In case you've just generated a new project via the vue-cli, you can go with this: Change the publicPath in vue.config.js module.exports = { publicPath: './', } Use hash-mode in router.js (this will append the route-path to your index.html with "#" before and you're able to call the index file directly without serving it first) import Vue from 'vue' import Router from 'vue-router' import Home from './views/Home.vue' Vue.use(Router) export default new Router({ mode: 'hash', base: process.env.BASE_URL, routes: [ { path: '/', name: 'home', component: Home }, { path: '/about', name: 'about', component: () => import('./views/About.vue') } ] }) Call the index.html after you built your project via npm run build and put the dist-Directory wherever your CEF files should be. mp.browsers.new('package://<PATH_TO_YOUR_CEF_DIR>/dist/index.html'); I just went with the default vue-cli app here and it works fine. Alternatively you just serve your vue app via http and call it, for example: mp.browsers.new('http://localhost:8080'); I like the index.html-ish solution more, because this way you have your CEF files neatly within your client_packages and nothing depends on another process running. 👍 1 Link to comment Share on other sites More sharing options...
MarcN Posted July 19, 2020 Share Posted July 19, 2020 On 7/6/2019 at 3:52 AM, deadnuts143 said: mp.browsers.new('http://localhost:8080'); Is there any way of such an externally loaded source accessing `mp.` ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now