mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2026-08-10 13:21:02 +00:00
update 优化 代码生成支持接入各种不同前端 只需要将模板放到vm文件夹下 前端传对应的文件夹名即可
This commit is contained in:
@@ -2,11 +2,19 @@
|
||||
|
||||
## 优先参考的代码来源
|
||||
|
||||
- `ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/*.vm`
|
||||
- `ruoyi-modules/ruoyi-gen/src/main/resources/vm/<frontendType>/*.vm`
|
||||
- 默认 Vue 模板在 `vm/vue`,React 模板在 `vm/react`
|
||||
- 前端工程中与目标模块最接近的现有页面
|
||||
|
||||
当前 boot4 仓库通常只含后端与 generator 前端模板;如果前端工程不在当前 root,先以 generator 模板约定为准,再对照用户提供的前端目录或相邻仓库。
|
||||
|
||||
## 前端模板选择规则
|
||||
|
||||
- `gen_table.frontend_type` 存字符串,值直接对应 `vm` 下的模板目录,例如 `vue`、`react`。
|
||||
- 生成器按 `vm/<frontendType>/api.ts.vm`、`types.ts.vm`、`index.*.vm`、`index-tree.*.vm` 查找模板。
|
||||
- 页面输出后缀由页面模板文件名决定:`index.vue.vm` 输出 `index.vue`,`index.tsx.vm` 输出 `index.tsx`。
|
||||
- 新增其他前端时优先只新增 `vm/<frontendType>` 目录和对应 VM 文件,不在 Java 代码里增加数字枚举或硬编码分支。
|
||||
|
||||
## API 文件规则
|
||||
|
||||
- 从 `@/utils/request` 引入 `request`。
|
||||
|
||||
Reference in New Issue
Block a user