import Vue from 'vue'; import VueRouter from 'vue-router'; Vue.use(VueRouter); const routes = [ { path: '/', meta: { title: '首页' }, component: () => import('../views/index.vue'), }, { path: '/anchor/index', meta: { title: '主播管理' }, component: () => import('../views/anchor/index.vue'), }, { path: '/anchor/detail', meta: { title: '主播详情' }, component: () => import('../views/anchor/detail.vue'), }, { path: '/role/index', meta: { title: '菜单管理' }, component: () => import('../views/role/index.vue'), }, { path: '/role/detail', meta: { title: '菜单详情' }, component: () => import('../views/role/detail.vue'), }, { path: '/live/index', meta: { title: '直播管理' }, component: () => import('../views/live/index.vue'), }, { path: '/room/index', meta: { title: '房间管理' }, component: () => import('../views/room/index.vue'), }, { path: '/room/detail', meta: { title: '房间详情' }, component: () => import('../views/room/detail.vue'), }, { path: '/stat/index', meta: { title: '统计管理' }, component: () => import('../views/stat/index.vue'), }, { path: '/test/index', meta: { title: '测试管理' }, component: () => import('../views/test/index.vue'), }, { path: '/test/detail', meta: { title: '添加' }, component: () => import('../views/test/detail.vue'), }, { path: '/login', meta: { title: '登录' }, component: () => import('../views/login.vue'), }, ]; const router = new VueRouter({ mode: 'history', base: process.env.NODE_ENV === 'development' ? '' : process.env.VUE_APP_ROUTER, routes, }); export default router;