client: router: always scroll to the top

This commit is contained in:
Matteo Pagliazzi
2017-03-07 19:34:29 +01:00
parent b75c57f130
commit b10751e874

View File

@@ -27,6 +27,11 @@ export default new VueRouter({
mode: 'history',
base: process.env.NODE_ENV === 'production' ? '/new-app' : __dirname, // eslint-disable-line no-process-env
linkActiveClass: 'active',
// When navigating to another route always scroll to the top
// To customize the behavior see https://router.vuejs.org/en/advanced/scroll-behavior.html
scrollBehavior () {
return { x: 0, y: 0 };
},
routes: [
{ name: 'tasks', path: '/', component: UserTasks },
{