import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '../components/HelloWorld'
import Login from '../view/login/Login'
import Index from '../view/index'
import StudentNavMenu from '../view/student/StudentNavMenu'
import StudentTestPlan from '../view/student/StudentTestPlan'
import StudentGradeList from '../view/student/StudentGradeList'
import StudentBaseInformation from '../view/student/StudentBaseInformation'
import TeacherNavMenu from '../view/teacher/TeacherNavMenu'
import UserNavMenu from '../view/user/UserNavMenu'
import SetNavMenu from '../view/set/SetNavMenu'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/HelloWorld',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/index',
      name: 'index',
      component: Index,
      meta: {
        title: '学生管理系统'
      },
      children: [{
        path: '/studentNavMenu',
        name: 'StudentNavMenu',
        component: StudentNavMenu,
        children: [{
          path: '/StudentTestPlan',
          name: 'StudentTestPlan',
          component: StudentTestPlan
        },
        {
          path: '/studentGradeList',
          name: 'StudentGradeList',
          component: StudentGradeList
        },
        {
          path: '/studentBaseInformation',
          name: 'StudentBaseInformation',
          component: StudentBaseInformation
        }
        ]
      },
      {path: '/teacherNavMenu',
        name: 'TeacherNavMenu',
        component: TeacherNavMenu
      },
      {path: '/userNavMenu',
        name: 'UserNavMenu',
        component: UserNavMenu
      },
      {
        path: '/setNavMenu',
        name: 'SetNavMenu',
        component: SetNavMenu
      }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    }
  ]
})

在children中添加路由
如果需要加载页面则 在页面中使用
在这里插入图片描述在这里插入图片描述
to 后面为子路由的地址

Logo

前往低代码交流专区

更多推荐