angular6 根据路由判断是否显示头部和底部
作者:互联网
private router: Router,
// 不显示底部的页面数组
hideFooterPage: Array<any> = [
'/spot/trade',
'/contract/trade',
'/bxa'
];
// 不显示头部的页面数组
hideHeaderPage: Array<any> = [
'/bxa'
];
/**
* 是否隐藏 底部 or 头部
*/
hideFooterHeader() {
const isHideFooter = this.hideFooterPage.some(item => {
return this.router.url.indexOf(item) === 0;
});
const isHideHeader = this.hideHeaderPage.some(item => {
return this.router.url.indexOf(item) === 0;
});
this.isHideFooter = isHideFooter;
this.isHideHeader = isHideHeader;
}
标签:isHideHeader,isHideFooter,hideFooterPage,some,angular6,item,头部,router,路由 来源: https://blog.csdn.net/weixin_42080477/article/details/97664085