这个是文档结构
export default {
treeShaking: true,
routes: [
{
path: '/',
component: '../layouts/index',
routes: [
{path: '/', component: '../pages/index'},
{path: '/time', component: '../pages/Time1'}
]
}
],
plugins: [
// ref: https://umijs.org/plugin/umi-plugin-react.html
['umi-plugin-react', {
antd: true,
dva: true,
dynamicImport: {webpackChunkName: true},
title: 'ashe-portal',
dll: true,
locale: {
enable: true,
default: 'en-US',
},
routes: {
exclude: [
/models\//,
/services\//,
/model\.(t|j)sx?$/,
/service\.(t|j)sx?$/,
/components\//,
],
},
}],
],
}
这是路由配置的文件
然后访问的时候每次都会报404
各位大佬帮忙看看这个问题,谢谢了
component 是相对于
src/pages
目录的去掉个点就行了
{path:'/',component:'./pages/index},
{path:'/time',component:'./pages/Time1'}