first commit
This commit is contained in:
50
src/router/Router.js
Normal file
50
src/router/Router.js
Normal file
@@ -0,0 +1,50 @@
|
||||
import { createWebHistory, createRouter } from 'vue-router'
|
||||
import Aericle from '../views/aericle.vue'
|
||||
import home from '../views/home.vue'
|
||||
import nonsense from '../views/nonsense.vue'
|
||||
import messageboard from '../views/messageboard.vue'
|
||||
import about from '../views/aboutme.vue'
|
||||
import articlecontents from '../views/articlecontents.vue'
|
||||
const routes = [
|
||||
{
|
||||
path: '/:type',
|
||||
// 如果type为空则是所有不为空查询相对应属性的文章
|
||||
name: '/home',
|
||||
component: home
|
||||
},
|
||||
{
|
||||
path: '/aericle',
|
||||
name: 'Aericle',
|
||||
component: Aericle
|
||||
},
|
||||
{
|
||||
path: '/nonsense',
|
||||
name: 'nonsense',
|
||||
component: nonsense
|
||||
|
||||
},
|
||||
{
|
||||
path: '/message',
|
||||
name: 'messageboard',
|
||||
component: messageboard
|
||||
|
||||
},
|
||||
{
|
||||
path: '/about',
|
||||
name: 'about',
|
||||
component: about
|
||||
|
||||
},
|
||||
{
|
||||
path: '/articlecontents/:url',
|
||||
name: 'articlecontents',
|
||||
component: articlecontents
|
||||
}
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes,
|
||||
})
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user