提交 a467fd97 authored 作者: vipcxj's avatar vipcxj

支持2级model

上级 529cc368
......@@ -127,6 +127,10 @@ const createRoutes = async (app, modules, groups, basePath) => {
modelBundle = await import(`./models/main/modules/${layout.route}`);
modelBundle = modelBundle.default;
registerModel(app, modelBundle);
const { subModels } = modelBundle;
if (subModels && subModels.forEach) {
subModels.forEach(m => registerModel(app, m));
}
let routeBundle = await import(`./routes/main/modules/${layout.route}`);
routeBundle = routeBundle.default || routeBundle;
route.component = routeBundle;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论