You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
734 B
42 lines
734 B
import {createRouter,createWebHistory} from 'vue-router'
|
|
import Home from '@/components/Home.vue'
|
|
import News from '@/components/News.vue'
|
|
import About from '@/components/About.vue'
|
|
import Detail from '@/components/Detail.vue'
|
|
|
|
const router = createRouter({
|
|
history:createWebHistory(),
|
|
routes:[
|
|
{
|
|
name:'zhuye',
|
|
path:'/home',
|
|
component:Home
|
|
},
|
|
{
|
|
name:'xinwen',
|
|
path:'/news',
|
|
component:News,
|
|
children:[
|
|
{
|
|
name:'xiangqing',
|
|
path:'detail/:id/:title/:content',
|
|
component:Detail,
|
|
props(route){
|
|
return route.query
|
|
}
|
|
}
|
|
]
|
|
|
|
},
|
|
{
|
|
name:'guanyu',
|
|
path:'/about',
|
|
component:About
|
|
},
|
|
{
|
|
path:'/',
|
|
redirect:'/home'
|
|
}
|
|
]
|
|
})
|
|
export default router
|