Vue route hopping

<div id="app">
<router-view></router-view>
<div class="">
 <router-link to="/">1</router-link>
<router-link to="/2">2</router-link>
<router-link to="/3">3</router-link>
<router-link to="/4">4</router-link>
</div>
</div>
//2
<div><router-link></div>

when I click router 1, br 2, 3, 4, the component renders to
, but what I want is that when I click 2, I jump to a new page and don"t want to see Navigation,

.

how should I layout and how should the route jump?

Mar.04,2021

you can write a watch to listen to the route, and hide the navigation when the route information becomes the route information of Route 2, otherwise it will be displayed


if the page is more recommended to make navigation into a nav component, use it when needed, and control the display of hiding in the page and so on.
if there are few pages, you can hide them through status management control.

Menu