Angular 星云公司主题不是现成的
我使用ng new设置了一个项目,然后按照说明将nebular添加到现有的应用程序中。我默认了宇宙。这导致了以下文件。因此,当我在NbThemeModule.forRoot()中将主题设置为cosmic或default时,它可以工作,但“corporate”不能。最终生成的屏幕在顶部被粉碎在一起 有人能告诉我,我需要做什么才能让“公司”运转起来吗?如果你知道任何关于星云主题的好教程,那就太好了。我完全不懂 app.module.ts:Angular 星云公司主题不是现成的,angular,visual-studio-code,nebular,Angular,Visual Studio Code,Nebular,我使用ng new设置了一个项目,然后按照说明将nebular添加到现有的应用程序中。我默认了宇宙。这导致了以下文件。因此,当我在NbThemeModule.forRoot()中将主题设置为cosmic或default时,它可以工作,但“corporate”不能。最终生成的屏幕在顶部被粉碎在一起 有人能告诉我,我需要做什么才能让“公司”运转起来吗?如果你知道任何关于星云主题的好教程,那就太好了。我完全不懂 app.module.ts: import { BrowserModule } f
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HomeScreenComponent } from './home-screen/home-screen.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NbThemeModule, NbLayoutModule, NbSidebarModule } from '@nebular/theme';
@NgModule({
declarations: [
AppComponent,
HomeScreenComponent
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
NbThemeModule.forRoot({ name: 'cosmic' }),
NbLayoutModule,
NbSidebarModule.forRoot()
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
theme.scss:
@import '~@nebular/theme/styles/theming';
@import '~@nebular/theme/styles/themes/cosmic';
$nb-themes: nb-register-theme((
// add your variables here like:
// color-bg: #4ca6ff,
), cosmic, cosmic);
angular.json:
"styles": [
"src/styles.scss"
],
我终于让“公司”运作起来,如下所示。我有很多东西要学。我希望这可能是像我这样的初学者。 我修改了themes.scs,如下所示:
$nb-themes: nb-register-theme((
// add your variables here like:
// color-bg: #4ca6ff,
), cosmic, cosmic);
$nb-themes: nb-register-theme((
// add your variables here like:
// color-bg: #4ca6ff,
), default , default);
$nb-themes: nb-register-theme((
// add your variables here like:
// color-bg: #4ca6ff,
), corporate , corporate);
我将其添加到angular.json文件中:
"styles": [
"src/styles.scss",
"node_modules/@nebular/theme/styles/prebuilt/corporate.css",
"node_modules/@nebular/theme/styles/prebuilt/cosmic.css",
"node_modules/@nebular/theme/styles/prebuilt/default.css"
],
我终于让“公司”运作起来,如下所示。我有很多东西要学。我希望这可能是像我这样的初学者。 我修改了themes.scs,如下所示:
$nb-themes: nb-register-theme((
// add your variables here like:
// color-bg: #4ca6ff,
), cosmic, cosmic);
$nb-themes: nb-register-theme((
// add your variables here like:
// color-bg: #4ca6ff,
), default , default);
$nb-themes: nb-register-theme((
// add your variables here like:
// color-bg: #4ca6ff,
), corporate , corporate);
我将其添加到angular.json文件中:
"styles": [
"src/styles.scss",
"node_modules/@nebular/theme/styles/prebuilt/corporate.css",
"node_modules/@nebular/theme/styles/prebuilt/cosmic.css",
"node_modules/@nebular/theme/styles/prebuilt/default.css"
],
根据您最初的问题,唯一要做的就是在您发布的代码部分中将
cosmic
提到的内容重命名为corporate
。以下是一个工作示例:
根据您最初的问题,唯一要做的就是在您发布的代码部分中将
cosmic
提到的内容重命名为corporate
。以下是一个工作示例:
您只需更改ngx admin/src/app/@theme/theme.module.ts文件第85行即可更改主题
..NbThemeModule.forRoot(
{
name: 'corporate', // change here it can be default, corporate, cosmic or dark
},
[ DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME, DARK_THEME ],
).provider
欲了解更多信息,请访问此处
它适用于最新版本。您只需更改ngx admin/src/app/@theme/theme.module.ts文件第85行即可更改主题
..NbThemeModule.forRoot(
{
name: 'corporate', // change here it can be default, corporate, cosmic or dark
},
[ DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME, DARK_THEME ],
).provider
欲了解更多信息,请访问此处
它适用于最新版本。将组件包装在
nb布局
和nb布局列
比如说
<nb-layout>
<nb-layout-column>
<input type="text" nbInput fullWidth status="basic" placeholder="Default">
</nb-layout-column>
</nb-layout>
将组件包装在
nb布局
和nb布局列
比如说
<nb-layout>
<nb-layout-column>
<input type="text" nbInput fullWidth status="basic" placeholder="Default">
</nb-layout-column>
</nb-layout>