当前位置: 首页 > Web前端 > vue.js

vue静态路由

时间:2023-03-31 15:59:10 vue.js

可以配合动态路由js部分使用//1。定义内容varroutes=[{path:'/',name:'HelloWorld',component:HelloWorld},{path:'/stu',name:'Stu',component:Stu},{path:'/person',name:'Person',component:Person},{path:'/job',name:'Job',component:Job},{path:'/jobAllot',name:'JobAllot',component:JobAllot},{path:'/notice',name:'Notice',component:Notice},{path:'/expressInspect',name:'ExpressInspect',component:ExpressInspect}];//2.声明varrouter=newVueRouter({mode:'history',routes:routes});//3.调用Vue.use(VueRouter);exportdefault{router:router,name:'App',components:{}}页面内容stu,人,job,jobAllot,注意ExpressInspect,


Emp.vue