1

我安装了 NG-ZORRO 以在我的项目中使用它,我首先使用他们的列表组件。

但我在以下元素上遇到错误:“nz-list-item-meta-title”不是已知元素,而 nz-list-item-action 不是已知元素

我导入了所有需要使用列表但总是有相同错误的模块。

nz-list-item-meta-title根本不存在......这里是 mu app.module.ts :

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NgZorroAntdModule, NZ_I18N, fr_FR } from 'ng-zorro-antd';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { registerLocaleData } from '@angular/common';
import fr from '@angular/common/locales/fr'
import { CollectionProgressComponent } from './collection-progress/collection- 
progress.component';
import {HttpClientModule} from "@angular/common/http";
import { TvComponent } from './tv/tv.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import { InConstructionComponent } from './in-construction/in-construction.component';
import { DonationComponent } from './donation/donation.component';
import { NzListModule } from 'ng-zorro-antd/list';
import { PostComponent } from './post/post.component';

registerLocaleData(fr);

@NgModule({
  declarations: [
    AppComponent,
    CollectionProgressComponent,
    TvComponent,
    DashboardComponent,
    InConstructionComponent,
    DonationComponent,
    PostComponent
   ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    NgZorroAntdModule,
    FormsModule,
    HttpClientModule,
    NzListModule,
    BrowserAnimationsModule
  ],
  providers: [{ provide: NZ_I18N, useValue: fr_FR }],
  bootstrap: [AppComponent]
})
export class AppModule { }
4

1 回答 1

0
 <nz-list nzItemLayout="horizontal">
          <nz-list-item>
            <nz-list-item-meta
              nzAvatar="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
              nzDescription="Ant Design, a design language for background applications, is refined by Ant UED Team"
              nzTitle="put title here"
            >  
            </nz-list-item-meta>
          </nz-list-item>
        </nz-list>

使用' nzTitle'属性替换' nz-list-item-meta-title'

于 2020-06-15T07:59:07.887 回答