{"size": 2539, "ext": "js", "max_stars_repo_path": "resources/js/router/index.js", "max_stars_repo_name": "hashmateteam/vue-blog", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/js/router/index.js", "max_issues_repo_name": "hashmateteam/vue-blog", "max_issues_repo_issues_event_min_datetime": "2021-02-02T19:11:12.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-19T03:28:39.000Z", "max_forks_repo_path": "resources/js/router/index.js", "max_forks_repo_name": "hashmateteam/vue-blog", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 24.6504854369, "max_line_length": 58, "alphanum_fraction": 0.442693974}
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter);


//Components
const AuthinWrapper = () =>
    import ('../interfaces/AuthinWrapper.vue')
const AuthupWrapper = () =>
    import ('../interfaces/AuthupWrapper.vue')

//Pages
const Index = () =>
    import ('../pages/Index')
const GuestIndex = () =>
    import ('../pages/guest/Index')
const UserIndex = () =>
    import ('../pages/user/Index')
const CreateArticle = () =>
    import ('../pages/user/CreateArticle')
const ViewArticle = () =>
    import ('../pages/guest/ViewArticle')
    //Declare static-routes
    /*
    const routes = [{
            name: 'authin',
            path: '/auth-in',
            component: AuthinWrapper
        },
        {
            name: 'authup',
            path: '/auth-up',
            component: AuthupWrapper
        },
        {
            name: 'index',
            path: '/',
            component: Index
        },
        {
            name: 'guestindex',
            path: '/@articles',
            component: GuestIndex
        },
        {
            name: 'userindex',
            path: '/u/@:username',
            component: UserIndex
        },
        {
            name: 'createarticle',
            path: '/u/@:username/:xid',
            component: CreateArticle
        }
    ];
    */
export default new VueRouter({
    mode: 'history', // https://router.vuejs.org/api/#mode
    linkActiveClass: 'active',
    scrollBehavior: () => ({ y: 0 }),
    routes: configRoutes()
})

function configRoutes() {
    return [{
        path: '/',
        redirect: '/@articles',
        name: 'index',
        component: Index,
        children: [{
                name: 'authin',
                path: '/auth-in',
                component: AuthinWrapper
            },
            {
                name: 'authup',
                path: '/auth-up',
                component: AuthupWrapper
            },
            {
                name: 'guestindex',
                path: '/@articles',
                component: GuestIndex
            },
            {
                name: 'userindex',
                path: '/u/@:username',
                component: UserIndex
            },
            {
                name: 'createarticle',
                path: '/u/@:username/:xid',
                component: CreateArticle
            },
            {
                name: 'viewarticle',
                path: '/articles/@:username/:xid',
                component: ViewArticle
            }
        ]
    }]
}