本文共 466 字,大约阅读时间需要 1 分钟。
import A from './A'; import B from './B'; const modules = [A,B]; class Index { static register(){ const { g_app: app } = window; let models = app._models; modules.forEach(module=>{ let namespace = module.namespace; let foundModule = models.find(model=>model.namespace === namespace); if(!foundModule){ app.model(module); } }); } } export default Index;
转载地址:http://hfsuk.baihongyu.com/