首页 > 解决方案 > 如何将角度动画附加到角度水平步进器cdk中的步骤之间的过渡?

问题描述

我正在使用cdk步进器来构建新的步进器,但我找不到为步骤之间的过渡附加角度动画的方法。有人可以帮助我吗?

我已经通过用 替换变量来尝试这个解决方案,但它没有按预期工作。currentstepper.selectedIndex

<app-custom-stepper #stepper>
   <cdk-step [@stepTransition]="stepper.selectedIndex === 0 ? 'current' : 'previous'
      ">
     <p>This is any content of "Step 1"</p>
   </cdk-step>
   <cdk-step  [@stepTransition]="stepper.selectedIndex === 1 ? 'current'
          : stepper.selectedIndex > 1
          ? 'previous'
          : 'next'
      ">
     <p>This is any content of "Step 2"</p>
   </cdk-step>
</app-custom-stepper>

标签: angularangular-cdkangular-material-stepper

解决方案


推荐阅读