Files
slader-legacy/slader-legacy-frontend/src/router/index.js
2021-08-01 23:51:52 +08:00

42 行
860 B
JavaScript

import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Textbook from "@/views/Textbook"
import Section from "@/views/Section"
import Exercise from "@/views/Exercise"
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'home',
component: Home
},
{
path: '/textbook/:textbook?',
name: 'textbook',
component: Textbook,
props: true
},
{
path: '/textbook/:textbook/section/:section',
name: 'section',
component: Section,
props: true
},
{
path: '/textbook/:textbook/section/:section/exercise/:exercise',
name: 'exercise',
component: Exercise,
props: true
}
]
const router = new VueRouter({
mode: "history",
routes: [...routes],
})
export default router