2023-02-26 13:17:19 +08:00
|
|
|
import { createRouter, createWebHistory } from 'vue-router'
|
2023-03-03 21:58:58 +08:00
|
|
|
import Layout from '../layout/Index.vue'
|
|
|
|
|
import NotFound from '../views/NotFound.vue'
|
2023-02-26 13:17:19 +08:00
|
|
|
const router = createRouter({
|
|
|
|
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
|
|
|
routes: [
|
|
|
|
|
{
|
|
|
|
|
path: '/',
|
2023-03-03 21:58:58 +08:00
|
|
|
name: 'layout',
|
|
|
|
|
component: Layout,
|
|
|
|
|
redirect: '/index' ,
|
|
|
|
|
children :[
|
|
|
|
|
{
|
|
|
|
|
name:'index',
|
|
|
|
|
path: '/index',
|
|
|
|
|
component: () => import('../views/Index.vue')
|
|
|
|
|
},
|
2023-03-05 20:30:44 +08:00
|
|
|
{
|
|
|
|
|
name:'article',
|
|
|
|
|
path: '/article',
|
|
|
|
|
component: () => import('../views/Article.vue')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name:'discuss',
|
2023-03-11 15:02:50 +08:00
|
|
|
path: '/discuss/:plateId',
|
2023-03-05 20:30:44 +08:00
|
|
|
component: () => import('../views/Discuss.vue')
|
|
|
|
|
},
|
2023-03-07 00:02:48 +08:00
|
|
|
{
|
|
|
|
|
name:'addArt',
|
|
|
|
|
path:'addArt',
|
|
|
|
|
component:()=>import('../views/AddArticle.vue')
|
|
|
|
|
}
|
2023-03-03 21:58:58 +08:00
|
|
|
]
|
2023-02-26 13:17:19 +08:00
|
|
|
},
|
2023-03-03 21:58:58 +08:00
|
|
|
{ path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound },
|
2023-02-26 13:17:19 +08:00
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export default router
|