import Vue from 'vue'
import Router from 'vue-router'
// import vantui from 'vant'
// import 'vant/lib/index.css'
import index from '@/components/pages/index'
import twentyFour from '@/components/pages/twentyFour'
import isRight from '@/components/pages/isRight'
import advanced from '@/components/pages/advanced'
import master from '@/components/pages/master'
import fun from '@/components/pages/fun'
import leader from '@/components/pages/leader'
Vue.use(Router)

export default new Router({
    routes: [{
        path: '/index',
        name: 'index',
        component: index,
        meta: {
            title: '首页',
            requireAuth: '' // 是否需要判断是否登录,这里是需要判断
        }
    }, {
        path: '/twentyFour',
        name: 'twentyFour',
        component: twentyFour,
        meta: {
            title: '入门级24点功能',
            requireAuth: '' // 是否需要判断是否登录,这里是需要判断
        }
    },
    {
        path: '/advanced',
        name: 'advanced',
        component: advanced,
        meta: {
            title: '进阶级24点功能',
            requireAuth: '' // 是否需要判断是否登录,这里是需要判断
        }
    },
    {
        path: '/master',
        name: 'master',
        component: master,
        meta: {
            title: '大师级24点功能',
            requireAuth: '' // 是否需要判断是否登录,这里是需要判断
        }
    },
    {
        path: '/fun',
        name: 'fun',
        component: fun,
        meta: {
            title: '奇趣级24点功能',
            requireAuth: '' // 是否需要判断是否登录,这里是需要判断
        }
    },
    {
        path: '/leader',
        name: 'leader',
        component: leader,
        meta: {
            title: '排行榜',
            requireAuth: '' // 是否需要判断是否登录,这里是需要判断
        }
    },
    {
        path: '/isRight',
        name: 'isRight',
        component: isRight,
        meta: {
            title: '验证24点功能',
            requireAuth: '' // 是否需要判断是否登录,这里是需要判断
        }
    },
 ]
})

const VueRouterPush = Router.prototype.push
Router.prototype.push = function push(to) {
    return VueRouterPush.call(this, to).catch(err => err)
}