init
This commit is contained in:
44
src/router/index.ts
Normal file
44
src/router/index.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
//创建路由器,并暴露出去
|
||||
|
||||
// 第一步 引入createRouter
|
||||
import {createRouter,createWebHistory} from "vue-router"
|
||||
//引入可能呈现的组件
|
||||
import NavContainer from '@/components/NavContainer.vue'
|
||||
import Preson from '@/components/Preson.vue'
|
||||
import Home from '@/components/Home.vue'
|
||||
import Service from '@/components/Service.vue'
|
||||
import Contact from '@/components/Contact.vue'
|
||||
import Problem from '@/components/Problem.vue'
|
||||
|
||||
// 第二步 创建路由器
|
||||
const router = createRouter({
|
||||
history:createWebHistory(),
|
||||
routes:[
|
||||
{
|
||||
path:'/',
|
||||
component:Home
|
||||
},
|
||||
{
|
||||
path:'/NavContainer',
|
||||
component:NavContainer
|
||||
},
|
||||
{
|
||||
path:'/Preson',
|
||||
component:Preson
|
||||
},
|
||||
{
|
||||
path:'/Service',
|
||||
component:Service
|
||||
},
|
||||
{
|
||||
path:'/Contact',
|
||||
component:Contact
|
||||
},
|
||||
{
|
||||
path:'/Problem',
|
||||
component:Problem
|
||||
},
|
||||
|
||||
]
|
||||
})
|
||||
export default router
|
||||
Reference in New Issue
Block a user