在这个例子中,我有角度材料表与扩展面板相结合。我可以单击并展开该行。 https://stackblitz.com/angular/keapqmllkjp?file=app%2Ftable-expandable-rows-example.ts为了创建切换事件,该代码中要更改什么?
非常感谢!
我想你从Angular的官方文档中提到了你的例子。
https://stackblitz.com/angular/qvokovdpnlx?file=app%2Ftable-expandable-rows-example.ts
在“table-expandable-example.html”的第32行上有错误的源代码。
错了:(点击)=“expandedElement = element”
正确:( click)=“expandedElement = expandedElement === element?null:element”