首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在ngx-admin模板中使组件全屏?

如何在ngx-admin模板中使组件全屏?
EN

Stack Overflow用户
提问于 2019-12-28 13:39:27
回答 1查看 375关注 0票数 0

我一直在尝试让我的新登录页面组件在ngx-admin模板中全屏显示。每当我尝试显示登录组件时,它都会出现在带有侧面导航的模板中。我在pages模块中创建了这个登录组件。请帮我把它转换成全屏。

代码语言:javascript
运行
复制
import { ExtraOptions, RouterModule, Routes } from '@angular/router';

import { NgModule } from '@angular/core';

    import {
      NbAuthComponent,
      NbLoginComponent,
      NbLogoutComponent,
      NbRegisterComponent,
      NbRequestPasswordComponent,
      NbResetPasswordComponent,
    } from '@nebular/auth';

import { LoginComponent } from './login/login.component';

const routes: Routes = [
  {path : '' , component: LoginComponent},
  { path: 'pages', loadChildren: 'app/pages/pages.module#PagesModule' },
   {
      path: 'auth',
      component: NbAuthComponent,
      children: [
        {
          path: '',
          component: NbLoginComponent,
        },
        {
          path: 'login',
          component: NbLoginComponent,
        },
        {
          path: 'register',
           component: NbRegisterComponent,
        },
        {
          path: 'logout',
          component: NbLogoutComponent,
       },
        {
          path: 'request-password',
         component: NbRequestPasswordComponent,
        },
        {
         path: 'reset-password',
          component: NbResetPasswordComponent,
       },
    ],
  },
  { path: '', redirectTo: 'login', pathMatch: 'full' },
  { path: '**', redirectTo: 'pages' },
];

const config: ExtraOptions = {
  useHash: true,
};

@NgModule({
  imports: [RouterModule.forRoot(routes, config)],
  exports: [RouterModule],
})
export class AppRoutingModule {
}
EN

回答 1

Stack Overflow用户

发布于 2020-01-25 00:15:32

要更改登录组件,您需要用您的自定义LoginComponent替换路由数组中的NbLoginComponent条目。

还要从路由数组中删除{path : '' , component: LoginComponent},{ path: '', redirectTo: 'login', pathMatch: 'full' },

如果您还需要修改身份验证组件的通用包装器(带上一步按钮的卡片),可以修改NbAuthComponent模板。

有关分步说明,请参阅custom auth components guide

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59508442

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档