我必须将ngx-admin设置为RTL样式。我必须把侧边栏设置好。经过一些研究,在这个Github项目中没有找到任何解决方案。任何人都可以帮助我解决这个问题。
发布于 2019-09-03 15:29:46
将file one- Change .layout.scss更改为
@import '../../styles/themes';
@import '~bootstrap/scss/mixins/breakpoints';
@import '~@nebular/theme/styles/global/breakpoints';
@include nb-install-component() {
.menu-sidebar ::ng-deep .scrollable {
padding-top: nb-theme(layout-padding-top);
}
.menu-sidebar-rtl{
order: 0 !important;
}
.menu-sidebar{
order: 2 !important;
}
}
并将文件one- change .layout.ts更改为
import {Component, OnInit} from '@angular/core';
import {NbLayoutDirection, NbLayoutDirectionService} from "@nebular/theme";
@Component({
selector: 'ngx-one-column-layout',
styleUrls: ['./one-column.layout.scss'],
template: `
<nb-layout windowMode>
<nb-layout-header fixed>
<ngx-header></ngx-header>
</nb-layout-header>
<nb-sidebar [ngClass]="sidebar_class" tag="menu-sidebar" responsive>
<ng-content select="nb-menu"></ng-content>
</nb-sidebar>
<nb-layout-column>
<ng-content select="router-outlet"></ng-content>
</nb-layout-column>
<nb-layout-footer fixed>
<ngx-footer></ngx-footer>
</nb-layout-footer>
</nb-layout>
`,
})
export class OneColumnLayoutComponent implements OnInit {
constructor(private directionService: NbLayoutDirectionService) {
}
ngOnInit(): void {
if ( this.layout_direction === NbLayoutDirection.RTL) {
this.sidebar_class = 'menu-sidebar-rtl';
}
}
layout_direction: NbLayoutDirection = this.directionService.getDirection();
sidebar_class: string = 'menu-sidebar';
}
发布于 2020-11-08 01:19:45
你应该做两件事:
1-在theme.module.ts中:
export class ThemeModule {
static forRoot(): ModuleWithProviders<ThemeModule> {
return {
ngModule: ThemeModule,
providers: [
...NbThemeModule.forRoot(
{
name: "default",
},
[DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME, DARK_THEME],
DEFAULT_MEDIA_BREAKPOINTS,
NbLayoutDirection.RTL
).providers,
],
};
}
}
我们添加:
DEFAULT_MEDIA_BREAKPOINTS,
NbLayoutDirection.RTL
2-对于侧边栏,将"start“添加到:
<nb-sidebar class="menu-sidebar" tag="menu-sidebar" responsive start>
<ng-content select="nb-menu"></ng-content>
</nb-sidebar>
发布于 2021-06-16 13:22:27
你所需要做的就是在标签上添加“正确”的单词:
<nb-sidebar state='collapsed' right class="menu-sidebar" tag="menu-sidebar" responsive end>
</nb-sidebar>
https://stackoverflow.com/questions/57752857
复制相似问题