Working on my Vue.js app, I encountered an interesting challenge:
The layout of the app is simple: it consists of a header, a main view, and a navigation section at the bottom. Depending on the current page the user is on, I want to display a main action in the header. Refer to the wireframes below:
My query is: Is there a way to seamlessly integrate the template and code into the header? Ideally, I would like to keep the logic and appearance (such as an icon with a label) within the corresponding component rather than in the header itself, as it lacks awareness of the current view.
The header and main view components do not have a parent-child relationship. The basic Vue.js template structure is as follows:
<div class="app-content">
<TheTopBar/>
<main>
<router-view></router-view>
</main>
<TheNavigationBar/>
</div>