I need help with my Vue.js web application that includes a side navigation menu component. This component uses conditional rendering to display only when necessary. Within the component, there is an image for the close button of the side menu.
<transition name="fade">
<div
v-if="side_menu_is_open"
...
>
<div
...
>
<div class="mt-3 p-2" @click="toggleSideMenu">
<img :src="require('../assets/icons/cancel.svg')" class="w-8">
</div>
<ul class="mt-4">
...
</ul>
</div>
</div>
</transition>
Everything is functioning properly, but I am experiencing a delay in loading the image file on the initial render/display of the side menu component. Is there a way to preload the image for conditional rendering even if the component is not yet loaded?