@ -1,37 +0,0 @@ |
|||
# Custom Setting Page |
|||
|
|||
There are several settings tabs from different modules. You can add a custom setting page to your project. |
|||
|
|||
1. Create a component with the following command: |
|||
|
|||
```bash |
|||
yarn ng generate component my-settings |
|||
``` |
|||
|
|||
2. Open the `app.component.ts` and modify the file as shown below: |
|||
|
|||
```js |
|||
import { Component } from '@angular/core'; |
|||
import { SettingTabsService } from '@abp/ng.core'; // imported SettingTabsService |
|||
import { MySettingsComponent } from './my-settings/my-settings.component'; // imported MySettingsComponent |
|||
|
|||
@Component(/* component metadata */) |
|||
export class AppComponent { |
|||
constructor(private settingTabs: SettingTabsService) // injected MySettingsComponent |
|||
{ |
|||
// added below |
|||
settingTabs.add([ |
|||
{ |
|||
name: 'MySettings', |
|||
order: 1, |
|||
requiredPolicy: 'policy key here', |
|||
component: MySettingsComponent, |
|||
}, |
|||
]); |
|||
} |
|||
} |
|||
``` |
|||
|
|||
Navigate to `/setting-management` route to see the changes: |
|||
|
|||
 |
|||
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 25 KiB |
@ -1,41 +0,0 @@ |
|||
# 自定义设置页面 |
|||
|
|||
不同的模块提供它们的设置选项卡. 你可以通过3个步骤在项目中自定义设置页面. |
|||
|
|||
1. 使用以下命令创建一个组件 |
|||
|
|||
```bash |
|||
yarn ng generate component my-settings |
|||
``` |
|||
|
|||
2. 打开 `app.component.ts` 做以下修改: |
|||
|
|||
```js |
|||
import { Component } from '@angular/core'; |
|||
import { SettingTabsService } from '@abp/ng.core'; // imported SettingTabsService |
|||
import { MySettingsComponent } from './my-settings/my-settings.component'; // imported MySettingsComponent |
|||
|
|||
@Component(/* component metadata */) |
|||
export class AppComponent { |
|||
constructor(private settingTabs: SettingTabsService) // injected MySettingsComponent |
|||
{ |
|||
// added below |
|||
settingTabs.add([ |
|||
{ |
|||
name: 'MySettings', |
|||
order: 1, |
|||
requiredPolicy: 'policy key here', |
|||
component: MySettingsComponent, |
|||
}, |
|||
]); |
|||
} |
|||
} |
|||
``` |
|||
|
|||
导航到 `/setting-management` 路由你会看到以下变化: |
|||
|
|||
 |
|||
|
|||
## 下一步是什么? |
|||
|
|||
- [懒加载 Scripts 与 Styles](./Lazy-Load-Service.md) |
|||
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 25 KiB |