mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tree:
2d55bda013
10.0-ai-docs
2024-06-21-Use_User-Defined_Function_Mapping_For_Global_Filter
8.0-prevent-stackoverflow-blazor
9.0-clear-breadcrumbs
BackgroundJob-ApplicationName-Test
Blazorise-Form-Submit
ExtensionPropertyPolicy-Test
IApplicationConfigurationContributor
IGuidGenerator
IReadOnlyAppService
InboxProcessor-OutboxSender
InteractiveServerRenderMode(prerender-true)
Issue-#23338
LockoutEnd-Time
NullAbpDistributedLock-patch
Operation-Rate-Limiting-Test
RandomHelper
Shared-User-Account
Testcontainers
Theme-Async
TimezoneHelpText
X509KeyStorageFlags
abp-plugin
abp-release-post
abp-studio/issue/2891
abp-united-pre-merge
add-loading-component
advanced-features
article/angular-multithreading
auto-merge/prerel-8-2/2729
auto-merge/prerel-9-0/3134
auto-merge/prerel-9-0/3181
auto-merge/rel-0-0/42712
auto-merge/rel-0-0/42712-1
auto-merge/rel-10-0/4007
auto-merge/rel-10-0/4064
auto-merge/rel-10-0/4133
auto-merge/rel-10-1/4237
auto-merge/rel-10-2/4454
auto-merge/rel-10-2/4463
auto-merge/rel-10-4/4526
auto-merge/rel-7-4/2239
auto-merge/rel-7-4/2263
auto-merge/rel-7-4/2276
auto-merge/rel-8-0/2472
auto-merge/rel-8-0/2715
auto-merge/rel-8-0/2741
auto-merge/rel-8-1/2527
auto-merge/rel-8-2/2851
auto-merge/rel-8-3/3151
auto-merge/rel-9-0/3296
auto-merge/rel-9-0/3304
auto-merge/rel-9-1/3656
auto-merge/rel-9-2/3571
auto-merge/rel-9-2/3652
aws-service-url
before-net10
blazor-full-stack-web-ui-interactiveauto
blazor-full-stack-web-ui-interactiveauto-modified
clear-breadcrumbs
cmskit-cache
copilot/allow-adding-public-website
copilot/sub-pr-24469
copilot/sub-pr-24636
copilot/sub-pr-24842
copilot/sub-pr-24889
copilot/sub-pr-24949
data-collection-code-review-2
data-collection-review-3
data-collection-review-5
dev
devnot-demo
dgnyldrm7-patch-1
docs-fix
docs-preview-8.3
docs-test-1
docs-unification
docs-unification-1-enhancements
docs/studio-2.2.1
docs/studio-2.2.2
docs/studio-2.2.3
docs/studio-2.2.4
document-abp-run-watch-command
document-index-backgroundjob
documentation/#20827-modular-monolith-application
documentation/20827
documentation/abp-extensible-form-doc
ebicoglu-patch-1
ebicoglu-patch-2
enhance-link-user
enisn-patch-1
enisn/blobstoring-bunnycdn
feat/#23955
feat/ai-assistant-article-enhancements
feat/dynamic-form-component
feat/mudblazor-mix
feat/typescript-on-mvc
feature/#19594
feature/#23180
feature/data-collection
feature/logo-provider
feature/ssr-migration-schematic
fix-admin-docs-test
fix/#20241
fix/#23795
fix/21899-resource-permission-refresh
fix/feature-allowed-providers-respected-by-management
fullstackblazor
gizem/HTML-encode-TagHelper-xss-test
gizem/security-logs
halil-presentation-2024-05
hybrid-ui
hybrid-ui-embedding
ingress-nginx/ingress-nginx
issue-#23231
issue-#3417
issue-#3591
issue-#3596
issue-#6679
issue-#6768
issue-18421
issue-19307
issue-20436
issue-20924-2
issue-21015
issue-22408
issue-23113
issue-23231
issue-23231-v2
issue-23286
issue-24272
issue-24438-test
issue-24635-test
issue-24672
issue-24674
issue-24918-2
issue-24918-bg-workers
issue-2884
issue-3384/L
issue-3596
issue-3870/L
issue-5131
issue-5384
issue-codemirror
issue-volo-21285
issue-vs-7809
issue/22675
issue/abp-ng-upgrade
issue/assign-available-port-for-suite
issue/updateAngularInstallers
jquery-form-extensions.js-v2
leptonx-versions
license-banner-localization
license-banner-localization-1
local-ref-basic-theme
maliming-patch-1
maliming-patch-2
maliming-patch-4
maliming/ParameterApiDescriptionModel
maliming/ShouldValidatePredicates
maliming/fix-blazor-wasm-stackoverflow-logging
maliming/issue-25457-layered-diagrams
maliming/mud-qa-fixes
maliming/suite-mudblazor-docs
mansur-vs-internal-#7864
mauiglobalbundle
migrating-abp-packages/core
migrating-abp-packages/identity
migrating-abp-packages/setting-management
migrating-abp-packages/tenant-management
migrating-abp-packages/theme-shared
oauth2-redirect.html
pr/2526
pr/6814
prerel-9.0
rel-1.0
rel-1.1
rel-10.0
rel-10.1
rel-10.2
rel-10.3
rel-10.4
rel-2.0
rel-2.1
rel-2.2
rel-2.3
rel-2.4
rel-2.5
rel-2.6
rel-2.7
rel-2.8
rel-2.9
rel-3.0
rel-3.1
rel-3.2
rel-3.3
rel-4.0
rel-4.1
rel-4.2
rel-4.3
rel-4.4
rel-5.0
rel-5.1
rel-5.2
rel-5.3
rel-6.0
rel-7.0
rel-7.1
rel-7.2
rel-7.3
rel-7.4
rel-8.0
rel-8.1
rel-8.2
rel-8.3
rel-9.0
rel-9.1
rel-9.2
rel-9.3
remove-deprecateds
return-code-vs-exception-article
revert-18876-blazor-full-stack-web-ui
revert-20264-EngincanV/cli-old-vs-new
revert-23436-Mapperly-maliming
salihozkara-patch-1
salihozkara-patch-2
salihozkara/ImproveBundleFile
salihozkara/blazorise-validation-message
salihozkara/complex-property
salihozkara/fix-image
salihozkara/fixDatePicker
salihozkara/mapperly-test
scrapstation/dev
social-login-usages
studio-custom-command-doc
studio-document-start-and-wait
template-config-provider
templates-version
test-branch-24299
test-fix/resource-permission-definition-bugs
test/distribution-batch-state-checker-projection-on-10.4
update-bundle
update-cli-docs
update-doc
update-latest-versions-7.4.3
update-latest-versions-8.1.2
update-latest-versions-8.1.5
update-latest-versions-8.2.3
update-latest-versions-9.0.7
update-latest-versions-9.1.0
update-upgrade-cod-23-08-2024
upgrade-command-doc
vs-internal-issue-#7727
vsInternal-viewcChangeHistory-localization
vsinternal-7565
zh-hans.json
ìssue-17361
0.10.0
0.11.0
0.12.0
0.13.0
0.14.0
0.15.0
0.16.0
0.17.0.0
0.18.0
0.18.1
0.19.0
0.20.0
0.20.1
0.21.0
0.22.0
0.3.7
0.4.0
0.4.1
0.4.1.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.3.2.1
v0.3.2.2
v0.3.3
v0.3.3.1
v0.3.3.2
v0.3.4
v0.3.5
v0.3.6
v0.6.2
v1.1.1
v9.2.0-preview
${ noResults }
2.6 KiB
2.6 KiB
替换组件
你可以将一些ABP的组件替换为你自己的自定义组件.
你可以替换但不能自定义默认ABP组件的原因是禁用或更改该组件的一部分可能会导致问题. 所以我们把这些组件称为可替换组件.
如何替换组件
创建一个你想要使用的新组件,添加到 AppModule 中的 declarations 和entryComponents 中.
然后打开 app.component.ts 使用 AddReplaceableComponent 将你的组件替换ABP组件. 如下所示:
import { ..., AddReplaceableComponent } from '@abp/ng.core'; // imported AddReplaceableComponent action
import { eIdentityComponents } from '@abp/ng.identity'; // imported eIdentityComponents enum
import { Store } from '@ngxs/store'; // imported Store
//...
export class AppComponent {
constructor(..., private store: Store) {} // injected Store
ngOnInit() {
this.store.dispatch(
new AddReplaceableComponent({
component: YourNewRoleComponent,
key: eIdentityComponents.Roles,
}),
);
//...
}
}
如何替换布局
每个ABP主题模块有3个布局,分别是ApplicationLayoutComponent, AccountLayoutComponent, EmptyLayoutComponent. 这些布局可以用相同的方式替换.
一个布局组件模板应该包含
<router-outlet></router-outlet>元素.
下面的例子解释了如何更换 ApplicationLayoutComponent:
运行以下命令在 angular 文件夹中生成布局:
yarn ng generate component shared/my-application-layout --export --entryComponent
# You don't need the --entryComponent option in Angular 9
在你的布局模板(my-layout.component.html)中添加以下代码:
<router-outlet></router-outlet>
打开 app.component.ts 添加以下内容:
import { ..., AddReplaceableComponent } from '@abp/ng.core'; // imported AddReplaceableComponent
import { eThemeBasicComponents } from '@abp/ng.theme.basic'; // imported eThemeBasicComponents enum for component keys
import { MyApplicationLayoutComponent } from './shared/my-application-layout/my-application-layout.component'; // imported MyApplicationLayoutComponent
import { Store } from '@ngxs/store'; // imported Store
//...
export class AppComponent {
constructor(..., private store: Store) {} // injected Store
ngOnInit() {
// added below content
this.store.dispatch(
new AddReplaceableComponent({
component: MyApplicationLayoutComponent,
key: eThemeBasicComponents.ApplicationLayout,
}),
);
//...
}
}
