1.引用依赖包:BlazorAnimate
2.在 index.html 文件中</body>节前引用脚本
<script src="_content/BlazorAnimate/blazorAnimateInterop.js"></script>3.加载组件动画放大过渡效果例子
@page "/animation" @using BlazorAnimate <h3>Animation in Blazor</h3> <hr /> <div class="row"> <div class="col-3"> <div class="form-group"> <button class="btn btn-primary" @onclick="MyAnimationRunclick" > Run Animation </button> </div> </div> <hr /> </div> <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(0.5)" IsManual="false" @ref="MyAnimation_1"> <Editforms></Editforms> </Animate> @code { private Animate MyAnimation_1; private void MyAnimationRunclick() { MyAnimation_1.Run(); } }
