Skip to content

Onion名称

系统会为每一个 bean class 自动分配一个 Onion 名称,格式如下:

bash
{moduleName}:{beanName}

举例

  • 模块 demo-student 中组件 test 的 Controller bean: ControllerTest
Class 名称Scene 名称Bean 标识Onion 名称Component 名称
ControllerTestcontrollerdemo-student.controller.testdemo-student:test= Onion 名称
  • 模块 a-routertabs 的 Model bean: ModelTabs
Class 名称Scene 名称Bean 标识Onion 名称Model 名称
ModelTabsmodela-routertabs.model.tabsa-routertabs:tabs= Onion 名称

App Config

有了通用的 Onion 名称,就可以在 App Config 中修改所有 bean class 的参数配置

src/front/config/config/config.ts

typescript
// onions
config.onions = {
  model: {
    'a-routertabs:tabs': {
      max: 10,
    },
  },
};

所有的配置都有类型提示,如下图所示:

  • 所有 SceneName 提示

  • 所有 OnionName 提示

  • 所有配置提示

基于 MIT 许可发布