路由文件及其使用
1、新建路由文件,根据路由的不同作用,划分成不同模块
export const mainRoutes=[
{
path:'/x',
component:X,
exact:true 如果需要精确匹配
},
{
path:'/x',
component:X
}
]
export const otherRoutes=[
...
]
2、构建路由:
index.js放置如登录等的入口路由
App.js放置登录后的主
原创
2020-06-25 11:11:43 ·
896 阅读 ·
0 评论