AngularMaterial-编译错误-'mat-cell'不是已知元素:
创始人
2024-10-28 07:01:43
0
  1. 确保在你的 app.module.ts 导入了 MatIconModule,MatTableModule 和 BrowserAnimationsModule:

import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { MatIconModule } from '@angular/material/icon'; import { MatTableModule } from '@angular/material/table';

@NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, BrowserAnimationsModule, MatIconModule, MatTableModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }

  1. 如果你在其他模块中使用了 MatTable,你需要在那些模块中导入 MatTableModule。

  2. 如果你的组件使用到 MatTable,确保在组件的 .ts 和 .html 文件中都正确引入了 MatTable:

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

@Component({ selector: 'app-example-table', templateUrl: './example-table.component.html', styleUrls: ['./example-table.component.css'] }) export class ExampleTableComponent {

displayedColumns: string[] = ['position', 'name', 'weight', 'symbol']; dataSource = ELEMENT_DATA;

}

No. {{element.position}} Name {{element.name}} Weight {{element.weight}} Symbol {{element.symbol}}

  1. 如果你对 Angular Material 不熟悉,建议先阅读官方文档:https://material.angular.io/。

相关内容

热门资讯

wepoker脚本!hhpok... wepoker脚本!hhpoker视频巡查真的假的(透视)教程-其实开挂真的有挂1、点击下载安装,h...
透视总结!wepoker透视脚... 透视总结!wepoker透视脚本免费下载(透视)wepoker有透视吗,教程方式(竟然有挂)-哔哩哔...
sohoo poker辅助器!... sohoo poker辅助器!wepoker钻石怎么看底牌(透视)教程-总是关于是有挂wepoker...
透视科普!hhpoker德州挂... 透视科普!hhpoker德州挂真的有吗(透视)wepoker怎么设置透视,教程阶段(有挂猫腻)-哔哩...
wepoker私人局规律!we... wepoker私人局规律!wepoker怎么挂飞机(透视)插件-真是详情真的有挂1、每一步都需要思考...
透视了解!agpoker辅助(... 透视了解!agpoker辅助(透视)pokemmo脚本辅助下载,教程手册(真是有挂)-哔哩哔哩1)p...
pokemmo手机脚本!德州透... pokemmo手机脚本!德州透视竞技联盟(透视)教程-都是关于真的是有挂1、玩家可以在德州透视竞技联...
大菠萝789辅助器下载!菠萝德... 大菠萝789辅助器下载!菠萝德普辅助器免费版在哪里(透视)方法-原来科普真的是有挂1、游戏颠覆性的策...
透视解迷!xpoker辅助怎么... 您好,wepoker有透视功能吗这款游戏可以开挂的,确实是有挂的,需要了解加去威信【13670430...
epoker透视底牌!wepo... epoker透视底牌!wepoker透视脚本苹果版(透视)技巧-确实有挂真的是有挂1、该软件可以轻松...