ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
## 菜单配置 > 详见文档的前端开发指南部分 #### 方式一 动态路由配置 ![WX20190514-183737@2x.png](https://i.loli.net/2019/05/14/5cda9aac9145956471.png "WX20190514-183737@2x.png")![WX20190514-183819@2x.png](https://i.loli.net/2019/05/14/5cda9ab18305955234.png "WX20190514-183819@2x.png") * 记得在角色菜单为该用户分配该新添加的菜单权限 #### 方式二 固定路由配置 * `src/router/router.js` ~~~ // 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里 export const otherRouter = { path: '/', name: 'otherRouter', redirect: '/home', component: Main, children: [ { path: 'test', title: '测试页面', name: 'test', component: () => import('@/views/xboot-vue-generator/test.vue') }, ] }; ~~~ ## 页面编写 ~~~ // test.vue文件 <template> <div> <Card> <h1>代码生成测试页 可将生成的代码全部粘贴至此test.vue文件</h1> </Card> </div> </template> ~~~ ## 获取后台数据 文件可以被访问后,接下来就是完善界面信息,从后台获取数据。获取数据的方法都写在和文件对应的api文件夹中。 ### axios()函数 axios()可以设置全局的配置,例如请求头信息,拦截器等,这样的好处是可以避免重复配置。`src/libs/axios.js`中已封装好各种请求方法。 关于axios()的使用可以参考:[https://www.kancloud.cn/yunye/axios/234845](https://www.kancloud.cn/yunye/axios/234845)