- vue 老架构(暂时不支持)
- react 新架构
- 快速创建主页面模板
- 快速创建 service 接口文件夹
- 通过接口文档快速生成接口封装,后期做成可视化(暂时不支持)
字段名 | 类型 | 是否必填 | 描述 | 默认值 |
---|---|---|---|---|
mode | react | vue |
true |
用来区分项目类型 | - |
type | ts | js |
true |
是 ts 还是 js 目前强制使用 ts | - |
pagePath | String |
true |
相对于根目录下页面文件夹存放的位置 | - |
apiPath | String |
true |
相对于根目录请求文件夹存放的位置 | - |
-
tool-cli init
-
tool-cli add
- 当 mode 是 react 时候,只需要输入相对 pagePath 下的路径即可
egg: { "mode": "react", "type": "ts", "pagePath": "./src/pages", "apiPath": "./src/api" } tool-cli add 请输入针对当前命令行的地址: ./demo //最后生成的文件则是 ./src/pages/demo
- 当 mode 是 react 时候,只需要输入相对 pagePath 下的路径即可