Angular 2 - PrimeNG - dataTable 一次展开一行

joh*_*ith 0 grid expandablelistview primeng angular

在 PrimeNG 中 - 有没有办法一次只允许扩展一行?

<p-dataTable [value]="cars" expandableRows="true">
        <p-column expander="true" styleClass="col-icon"></p-column>
         <p-column field="vin" header="Vin"></p-column>
        <ng-template let-car pTemplate="rowexpansion">
         ...
</p-dataTable>
Run Code Online (Sandbox Code Playgroud)

Man*_*ram 6

试着在下面使用 <p-dataTable [value]="cars" rowExpandMode="single" expandableRows="true">

添加 rowExpandMode="single" 以一次打开一行。