Angular material 可扩展 table 不起作用
Angular material expandable table doesn't work
我想重现 https://material.angular.io/components/table/examples 中的 "Table with expandable rows" 示例。我创建了一个新的 Angular 项目,添加了 Angular material 并将示例内容直接复制到我的项目中。然而,行并没有像示例中那样扩展。我正在尝试不同的进口产品、不同的风格——什么都没有。我错过了什么?
外观如下:
这是我在 stackblitz 上的项目:https://stackblitz.com/edit/github-fc2cyw-ftpmac
您编辑的 Stackblitz:https://stackblitz.com/edit/github-fc2cyw-wtqvd4
将样式 url 从 table.component.html 更改为 table.component.css
@Component({
selector: 'app-table',
styleUrls: ['table.component.html'],
templateUrl: 'table.component.css',
animations: [
trigger('detailExpand', [
state('collapsed', style({height: '0px', minHeight: '0'})),
state('expanded', style({height: '*'})),
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
]),
],
我想重现 https://material.angular.io/components/table/examples 中的 "Table with expandable rows" 示例。我创建了一个新的 Angular 项目,添加了 Angular material 并将示例内容直接复制到我的项目中。然而,行并没有像示例中那样扩展。我正在尝试不同的进口产品、不同的风格——什么都没有。我错过了什么?
外观如下:
这是我在 stackblitz 上的项目:https://stackblitz.com/edit/github-fc2cyw-ftpmac
您编辑的 Stackblitz:https://stackblitz.com/edit/github-fc2cyw-wtqvd4
将样式 url 从 table.component.html 更改为 table.component.css
@Component({
selector: 'app-table',
styleUrls: ['table.component.html'],
templateUrl: 'table.component.css',
animations: [
trigger('detailExpand', [
state('collapsed', style({height: '0px', minHeight: '0'})),
state('expanded', style({height: '*'})),
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
]),
],