Angular5 ng-bootstrap - 如何只使用 ngb-panel

Angular5 ng-bootstrap - how to use just the ngb-panel

如何只渲染手风琴外的面板?

这不会渲染任何东西...

 <ngb-panel title="Login">
  <ng-template ngbPanelContent>
    Hello
  </ng-template>
 </ngb-panel>

但这确实如此(具有可折叠的手风琴行为 - 我不想要...)

<ngb-accordion #acc="ngbAccordion" activeIds="ngb-panel-0">
 <ngb-panel title="Login">
  <ng-template ngbPanelContent>
    Hello
  </ng-template>
 </ngb-panel>
</ngb-accordion>

根据 Bootstrap 4 documentation, the Panel component has been replaced by the Card component,它不包含在 ng-bootstrap 中,因为它只是通过 CSS 选择器的样式获得。

对于那些有兴趣在 Accordion 之外使用可折叠容器的人,他们可以使用 ng-bootstrap 的 Collapse component.