自定义设置页面

不同的模块提供它们的设置选项卡. 你可以通过3个步骤在项目中自定义设置页面.

  1. 使用以下命令创建一个组件
  1. yarn ng generate component my-settings
  1. 打开 app.component.ts 做以下修改:
  1. import { Component } from '@angular/core';
  2. import { SettingTabsService } from '@abp/ng.core'; // imported SettingTabsService
  3. import { MySettingsComponent } from './my-settings/my-settings.component'; // imported MySettingsComponent
  4. @Component(/* component metadata */)
  5. export class AppComponent {
  6. constructor(private settingTabs: SettingTabsService) // injected MySettingsComponent
  7. {
  8. // added below
  9. settingTabs.add([
  10. {
  11. name: 'MySettings',
  12. order: 1,
  13. requiredPolicy: 'policy key here',
  14. component: MySettingsComponent,
  15. },
  16. ]);
  17. }
  18. }

导航到 /setting-management 路由你会看到以下变化:

Custom Settings Tab

下一步是什么?