参考官网
Ant Design Pro是一个企业级中后台前端/设计解决方案
安装
- 新建一个空的文件夹作为项目目录,并在目录下执行:
yarn create umi
或npm create umi
- 选择ant-design-pro
Select the boilerplate type (Use arrow keys)
❯ ant-design-pro - Create project with an layout-only ant-design-pro boilerplate, use together with umi block.
app - Create project with a simple boilerplate, support typescript.
block - Create a umi block.
library - Create a library with umi.
plugin - Create a umi plugin.
接下来等他clone完成
4.基本操作——运行 npm install
装依赖,等个一万年就好了。
5. npm start
走起,浏览器访问http://localhost:8000/就可以得到下图
低版本迁移至4.0
❯❯❯ create-umi
? Select the boilerplate type ant-design-pro
? 🤓 Which language do you want to use? TypeScript
? 🦄 Want to use better and faster antd? Yes
- 在4.0里面无法通过设置icon设置菜单图标要使用插件
yarn add umi-plugin-antd-icon-config -D
- config.ts中
export default {
plugins: [['umi-plugin-antd-icon-config', {}]],
};
还有一些简单的改动看官网文档。