English 中文(简体)
Angular: 甚至没有工作的大男子的生活方式也以风格列出。
原标题:Angular: Styles from primeng not working even they are listed in styles.scss

我为我的“安热”项目增添了素。 但这些风格并不奏效。

我的风格是风格的。 json,但总是一刀切。

我的风格:

@import  ../node_modules/primeng/resources/themes/lara-light-blue/theme.css ;
@import  ../node_modules/primeicons/primeicons.css ;
@import  ../node_modules/primeng/resources/primeng.min.css ;

My complete angular.json: I have to give some more details to the code to save it so I do it here.

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "gw-spc": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        }
      },
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/gw-spc",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "node_modules/primeicons/primeicons.css",
              "node_modules/primeng/resources/themes/lara-light-blue/theme.css",
              "node_modules/primeng/resources/primeng.min.css",
              "node_modules/primeflex/primeflex.css",
              "src/styles.scss"
            ],
            "scripts": [
              "node_modules/chart.js/dist/chart.js"
            ],
            "vendorChunk": true,
            "extractLicenses": false,
            "buildOptimizer": false,
            "sourceMap": true,
            "optimization": false,
            "namedChunks": true
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "6kb",
                  "maximumError": "10kb"
                }
              ]
            }
          },
          "defaultConfiguration": ""
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "gw-spc:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "gw-spc:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "gw-spc:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.spec.json",
            "karmaConfig": "karma.conf.js",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "node_modules/primeicons/primeicons.css",
              "node_modules/primeng/resources/themes/lara-light-blue/theme.css",
              "node_modules/primeng/resources/primeng.min.css",
              "node_modules/primeflex/primeflex.css",
              "src/styles.scss"
            ],
            "scripts": []
          }
        },
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "gw-spc:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "gw-spc:serve:production"
            }
          }
        }
      }
    }
  }
}

Mylogin.component.html:

<h3 class="p-text-center p-pt-2" >Anmelden</h3>
<hr>
<form [formGroup]="loginForm" (ngSubmit)="anmelden_click()" class="ui-fluid m-3">
  <div class="ui-fluid">
    <div class="p-field">
      <label for="benutzer">Benutzername:</label>
      <p-autoComplete formControlName="benutzer" id="benutzer" [suggestions]="filteredUser"
        (completeMethod)="search($event)" [emptyMessage]=" Kein Benutzer! "
        [required]="true"></p-autoComplete>
    </div>
    <div class="p-field">
      <label for="passwort">Passwort/PIN:</label>
      <input formControlName="passwort" id="passwort" type="password" pPassword [feedback]="false">
    </div>
    <div>
      <label class="schrift-kleiner schrift-rot" controlName="fehler"></label>
    </div>
    <!--div class="p-field">
      <label for="werk">Werk:</label>
      <p-dropdown formControlName="werk" [options]="werke" [(ngModel)]="selectedWerk" optionLabel="name"></p-dropdown>
    </div>
    <div>
      <label class="schrift-kleiner schrift-rot" controlName="fehlerWerk"></label>
    </div-->
  </div>
  <div class="p-formgroup-inline p-jc-center">
    <p-button styleClass="ui-button-success" label="anmelden"></p-button>
  </div>
</form>

I站点:

“entergraph

为什么不做我错做的事情,请帮助。

The Index.html: enter image description here

“在座的影像描述”/</a

最佳回答

过去,我经常遇到这一问题。

我唯一为我工作的事情是,在我的项目中使用不同的初级版本。 它希望以不同版本左右,为其中之一工作。

问题回答

我也存在同样的问题。 解决办法是,在“品牌”一节中添加“node_modules/primeng/resources/primeng.min.cs”和“node_modules/primeicons/primeicons”。

`  
      "styles": [
          "src/main/webapp/content/scss/vendor.scss", 
          "src/main/webapp/content/scss/global.scss",
          "node_modules/primeng/resources/primeng.min.css",
          "node_modules/primeng/resources/themes/saga-blue/theme.css",
          "node_modules/primeicons/primeicons.css"]
`

如果你在项目中列入boot锁,则新版本的 prime和boot之间发生冲突。





相关问题
Creating a Style in code behind

Does anyone know how to create a wpf Style in code behind, I can t find anything on the web or MSDN docs. I have tried this but it is not working: Style s = new Style(typeof(TextBlock)); s....

WPF Custom Themes

I have a simple question which is giving me some difficulty. I have downloaded a custom them for WPF of the net. Now i want to apply this theme to my App instead of the default one. How do i do that,...

Is it sometimes bad to use <BR />?

Is it sometimes bad to use <BR/> tags? I ask because some of the first advice my development team gave me was this: Don t use <BR/> ; instead, use styles. But why? Are there negative ...

WPF - How to apply effect to a cropped image?

I have an Image being clipped like so: <Image Width="45" Grid.Column="0" Source="{Binding Photo}"> <Image.Clip> <RectangleGeometry Rect="0,0,45,55" RadiusX="8" RadiusY="8" /...

WPF ListView : Header styling

I want to have a ListView with columns and a particular style: The background for ALL column headers should be transparent except when the mouse is over in one of them. When this happends, the ...

热门标签