为什么 mt 分页不起作用
export class AppComponent implements OnInit {
title = 'app';
displayedColumns: string[] = ['position', 'name', 'weight', 'symbol'];
dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
@ViewChild(MatPaginator) paginator: MatPaginator;
ngOnInit() {
this.dataSource.paginator = this.paginator;
}
这与我从https://material.angular.io/components/table/overview复制的示例相同