fix: transition组件热重载显示页面空白bug

This commit is contained in:
H0nGzA1
2023-09-16 02:00:22 +08:00
committed by 李强
parent 58b59c2ed0
commit 496c453615

View File

@@ -3,12 +3,15 @@
<router-view v-slot="{ Component }"> <router-view v-slot="{ Component }">
<transition :name="setTransitionName" mode="out-in"> <transition :name="setTransitionName" mode="out-in">
<keep-alive :include="getKeepAliveNames" v-if="showView"> <keep-alive :include="getKeepAliveNames" v-if="showView">
<div>
<component :is="Component" :key="state.refreshRouterViewKey" class="w100" v-show="!isIframePage" /> <component :is="Component" :key="state.refreshRouterViewKey" class="w100" v-show="!isIframePage" />
</div>
</keep-alive> </keep-alive>
</transition> </transition>
</router-view> </router-view>
<transition :name="setTransitionName" mode="out-in"> <transition :name="setTransitionName" mode="out-in">
<Iframes class="w100" v-show="isIframePage" :refreshKey="state.iframeRefreshKey" :name="setTransitionName" :list="state.iframeList" /> <Iframes class="w100" v-show="isIframePage" :refreshKey="state.iframeRefreshKey" :name="setTransitionName"
:list="state.iframeList" />
</transition> </transition>
</div> </div>
</template> </template>