2019-10-04 02:47:44 +00:00
|
|
|
import Vue from 'vue'
|
|
|
|
import Router from 'vue-router'
|
|
|
|
import Home from './views/Home.vue'
|
|
|
|
import Profile from './views/Profile.vue'
|
|
|
|
|
|
|
|
Vue.use(Router)
|
|
|
|
|
|
|
|
export default new Router({
|
|
|
|
mode: 'history',
|
|
|
|
routes: [
|
|
|
|
{
|
|
|
|
path: '/',
|
|
|
|
name: 'home',
|
|
|
|
component: Home
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/u/:name',
|
|
|
|
name: 'profile',
|
|
|
|
component: Profile,
|
2019-11-18 01:31:58 +00:00
|
|
|
props: true
|
2019-10-04 02:47:44 +00:00
|
|
|
}
|
2019-11-18 01:48:11 +00:00
|
|
|
],
|
|
|
|
scrollBehavior (to, from, savedPosition) {
|
|
|
|
if (savedPosition) {
|
|
|
|
return savedPosition
|
|
|
|
} else {
|
|
|
|
return { x: 0, y: 0 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-04 02:47:44 +00:00
|
|
|
})
|