View Swapping and Animation
Aurelia provides strategies for controlling how views are swapped when navigating between routes. This is particularly useful when implementing animations.
Setting Swap Order
You can set the swap order strategy on the <router-view>
element:
Available swap order strategies are:
before
: Animate the new view in before removing the current viewwith
: Animate the new view at the same time the current view is removedafter
: Animate the new view in after the current view has been removed (default)
Implementing Animations
You'll typically use Aurelia's animation module and the swap order strategy to implement animations. Here's a basic example:
Then in your CSS:
Last updated
Was this helpful?