0👍
✅
As mentioned in the documentation–
router-view will display the component that corresponds to the URL.
You can put it anywhere to adapt it to your layout.
As per the above definition, your button is in the same file where your router-view
is. That means every route’s component will render where <router-view>
is and so does would have the button at the top.
So, a solution would be-
- Create a home route that will render a
Home.vue
component and put your<router-link>
there. - In
App.vue
, leave onlyrouter-view
.
Source:stackexchange.com