Transition with "out-in" not working
Vue version
^3.2.37
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-tdnmyq
Steps to reproduce
in App.vue
<script setup>
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://vuejs.org/api/sfc-script-setup.html#script-setup
import { shallowRef } from 'vue';
import ComA from './views/ComA.vue';
import ComB from './views/ComB.vue';
const Component = shallowRef(ComA);
</script>
<template>
<label> <input type="radio" v-model="Component" :value="ComA" /> A </label>
<label> <input type="radio" v-model="Component" :value="ComB" /> B </label>
<Transition name="fade" mode="out-in">
<component :is="Component"></component>
</Transition>
</template>
<style>
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s ease;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
</style>
views/ComA.vue
<script setup></script>
<template>Comp A</template>
views/ComB.vue
<script setup></script>
<template>Comp B</template>
What is expected?
What is actually happening?
if use "out-in" no next components come in
<Transition name="fade" mode="out-in">
<component :is="xxx"></component>
</Transition>
but use "in-out" its working
<Transition name="fade" mode="in-out">
<component :is="xxx"></component>
</Transition>
System Info
System:
OS: Windows 10 10.0.22000
CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700KF
Memory: 16.47 GB / 31.82 GB
Binaries:
Node: 16.15.0 - E:\environment\nodejs\node.EXE
Yarn: 1.22.18 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.5.5 - E:\environment\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22000.120.0), Chromium (103.0.1264.71)
Internet Explorer: 11.0.22000.120
Any additional comments?
No response