【发布时间】:2020-07-31 06:32:08
【问题描述】:
**如何在页面结果 1-5 中不显示导航栏而在所有其他页面中显示它,是否可以在此文件中更改它? **
<BrowserRouter>
<div>
<Navbar />
<Switch>
<Route path="/" component={Home} exact />
<Route path="/Aboutus" component={Aboutus} />
<Route path="/Contactus" component={ContactUs} />
<Route path="/selecttemplate" component={SelectT} />
}/>
}/>
}/>
</Switch>
</div>
<Route path="/result1" component={Result1} />
<Route className='FullHeight' path="/result2" component={Result2} />
<Route className='FullHeight' path="/result3" component={Result3} />
<Route className='FullHeight' path="/result4" component={Result4} />
<Route className='FullHeight' path="/result5" component={Result5} />
</BrowserRouter>
);
} }
【问题讨论】:
-
您好 Zaina,您需要提供更多详细信息以便我们为您提供帮助。此外,您发布的代码也不正确,因为导航栏需要位于第一个 switch 语句中
标签: javascript html reactjs routing