Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/bootstrap.js
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | unbind (el) { | ||||
$(el).tooltip('dispose') | $(el).tooltip('dispose') | ||||
} | } | ||||
}) | }) | ||||
Vue.use(Toast) | Vue.use(Toast) | ||||
Vue.use(VueRouter) | Vue.use(VueRouter) | ||||
let vueRouterBase = '/' | |||||
try { | |||||
let url = new URL(window.config['app.url']) | |||||
vueRouterBase = url.pathname | |||||
} catch(e) { | |||||
// ignore | |||||
} | |||||
window.router = new VueRouter({ | window.router = new VueRouter({ | ||||
base: vueRouterBase, | |||||
mode: 'history', | mode: 'history', | ||||
routes: window.routes, | routes: window.routes, | ||||
scrollBehavior (to, from, savedPosition) { | scrollBehavior (to, from, savedPosition) { | ||||
// Scroll the page to top, but not on Back action | // Scroll the page to top, but not on Back action | ||||
return savedPosition || { x: 0, y: 0 } | return savedPosition || { x: 0, y: 0 } | ||||
} | } | ||||
}) | }) | ||||
Show All 31 Lines |