我正在使用一些选项卡。在切换选项卡时有没有一种方法可以添加动画效果(向左/向右滑动)?
代码
viewMode = 'tab1';
<div class="container">
<div class="tab-slider--nav">
<ul class="tab-slider--tabs">
<li class="tab-slider--trigger" [class.active]="viewMode == 'tab1'" rel="tab1" (click)="viewMode ='tab1'">Tab 1</li>
<li class="tab-slider--trigger" [class.active]="viewMode == 'tab2'" rel="tab2" (click)="viewMode ='tab2'">Tab 2</li>
</ul>
</div>
<div class="tab-slider--container" [ngSwitch]="viewMode">
<div id="tab1" class="tab-slider--body" *ngSwitchCase="'tab1'">
<h2>First Tab</h2>
<p>Toggle switch style tab navigation. Currently only works with two tabs.</p>
<p>asdasd.</p>
</div>
<div id="tab2" class="tab-slider--body" *ngSwitchCase="'tab2'">
<h2>Second Tab</h2>
<p>asdad</p>
</div>
</div>
</div>