Performance: Transition modes (in-out, out-in)
MEDIUM IMPACT
This affects the smoothness and timing of element transitions, impacting rendering speed and visual stability during animations.
<transition mode="out-in"> <component :is="currentComponent" /> </transition>
<transition>
<component :is="currentComponent" />
</transition>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Default mode (simultaneous) | 2 element changes | 2 reflows (enter + leave) | High paint cost due to layout thrashing | [X] Bad |
| out-in mode (leave then enter) | 2 element changes | 1 reflow (sequential) | Lower paint cost, smoother transition | [OK] Good |
| in-out mode (enter then leave) | 2 element changes | 1 reflow (sequential) | Lower paint cost, better perceived responsiveness | [OK] Good |