diff --git a/src/resources/js/bootstrap.js b/src/resources/js/bootstrap.js --- a/src/resources/js/bootstrap.js +++ b/src/resources/js/bootstrap.js @@ -50,7 +50,16 @@ Vue.use(VueRouter) +let vueRouterBase = '/' +try { + let url = new URL(window.config['app.url']) + vueRouterBase = url.pathname +} catch(e) { + // ignore +} + window.router = new VueRouter({ + base: vueRouterBase, mode: 'history', routes: window.routes, scrollBehavior (to, from, savedPosition) {