可以结合动态路由一起使用
//1.定义内容
var routes = [
{ 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.声明
var router = new VueRouter({
mode: 'history',
routes:routes
});
//3.调用
Vue.use(VueRouter);
export default {
router: router,
name: 'App',
components: {
}
}
<router-link to="/stu">stu</router-link>,
<router-link to="/person">person</router-link>,
<router-link to="/job">job</router-link>,
<router-link to="/jobAllot">jobAllot</router-link>,
<router-link to="/notice">notice</router-link>,
<router-link to="/expressInspect">ExpressInspect</router-link>,
<hr>
<router-view>Emp.vue</router-view>
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。