1.安装

  1. yarn add @umijs/preset-ui -D

2.修改package.json

  1. "scripts": {
  2. "start": "umi dev",
  3. //这里修改了启动配置项
  4. "start:umi-ui": "UMI_UI=1 umi dev",
  5. "build": "umi build",
  6. "postinstall": "umi generate tmp",
  7. "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
  8. "test": "umi-test",
  9. "test:coverage": "umi-test --coverage"
  10. },

3.启动

  1. yarn start