I am currently working on a Single Page Application using Vue. The default layout consists of some HTML in the header, followed by an abstract child component that is injected into the page. Each child component has a loader to display while the data is being fetched from the server and rendered:
<navbar/>
<child id="main-content"/>
Now, I have a requirement to add a footer to each page. However, adding the footer in the parent default layout results in a not-so-pleasant user experience as the footer is shown only after the data is loaded in the child component, following the header and loading icon:
<navbar/>
<child id="main-content"/>
<footer>
Content for my footer which should be hidden until the child component has finished rendering
</footer>
Is there a way to hide the footer in the parent component until the child component has fully rendered its data without needing to modify each child component with $emit? I am looking for a solution that can be applied globally from the parent component.