Commit 99e714a4 authored by henrydf's avatar henrydf Committed by niko

扩展dymaicWrapper,防止Model重复导入报错 (#506)

* 扩展dymaicWrapper,防止Model重复导入报错

* fix ci
parent e221476b
...@@ -5,7 +5,8 @@ import { getMenuData } from './menu'; ...@@ -5,7 +5,8 @@ import { getMenuData } from './menu';
// wrapper of dynamic // wrapper of dynamic
const dynamicWrapper = (app, models, component) => dynamic({ const dynamicWrapper = (app, models, component) => dynamic({
app, app,
models: () => models.map(m => import(`../models/${m}.js`)), // eslint-disable-next-line no-underscore-dangle
models: () => models.filter(m => !app._models.some(({ namespace }) => namespace === m)).map(m => import(`../models/${m}.js`)),
// add routerData prop // add routerData prop
component: () => { component: () => {
const p = component(); const p = component();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment