我正在尝试制作折叠动画,但没有布尔指示器isCollapsed
,因为我有很多元素,并且我不想创建很多布尔值,所以有没有办法在没有布尔指示器的情况下做到这一点?
<button type="button" class="btn btn-primary" (click)="isCollapsed = !isCollapsed"
[attr.aria-expanded]="!isCollapsed" aria-controls="collapseBasic">Toggle collapse
</button>
<hr>
<div id="collapseBasic" [collapse]="isCollapsed">
<div class="well well-lg card card-block card-header">Some content</div>
</div>
成分:
import { Component } from '@angular/core';
@Component({
selector: 'collapse-demo',
templateUrl: './basic.html'
})
export class CollapseDemoComponent {
isCollapsed = false;
}
谢谢你!
这个例子来自文档https://valor-software.com/ngx-bootstrap/#/collapse#examples
您可以有很多折叠组件。
<collapse-demo-animation content="content a"></collapse-demo-animation>
<collapse-demo-animation content="content b"></collapse-demo-animation>
<collapse-demo-animation content="content c"></collapse-demo-animation>
<collapse-demo-animation content="content d"></collapse-demo-animation>
<collapse-demo-animation content="content e"></collapse-demo-animation>
<collapse-demo-animation content="content f"></collapse-demo-animation>
https://stackblitz.com/edit/angular-ryym9l-uvya9e https://stackblitz.com/edit/angular-ryym9l-uvya9e
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)