I am currently implementing lazy loading features for my single-page application using Vue.js and Laravel Mix 5. I am looking for a way to display a loading page to prevent the app from appearing unresponsive while new pages are loading.
I attempted to add the following code:
<template>
<div>
<!-- header -->
<transition
enter-active-class="animated fadeInDown"
leave-active-class="animated fadeOutUp"
mode="out-in"
>
<router-view name="header"></router-view>
</transition>
<!-- body -->
<transition
enter-active-class="animated fadeIn"
leave-active-class="animated fadeOut"
mode="out-in"
>
<router-view></router-view>
</transition>
</div>
</template>
Initially, I expected this code to trigger a fade-out animation while waiting for the new page to load. However, in reality, the screen does not animate as expected and the app seems unresponsive (even though buttons still function).
My proposed solution is that when a user clicks to navigate to a new page, I want to hide or remove the current page to indicate that something is happening behind the scenes and prevent users from repeatedly clicking buttons, thinking the website is unresponsive.