cd www
npm start
cd www
npm build
路由和菜单路由和菜单是同一段代码配置的。
- 路由不在菜单中显示,配置: hideInMenu 为true。
- 如果菜单从服务器获取。 src/layouts/BasicLayout.tsx 中修改 menuDataRender。并在代码中发起 http 请求。
在 /config/config.js
的 routers 字段中配置。
路由api用 umi 的history。如
import { history } from 'umi'
history.push('/list')
history.goBack()