header组件写到了App.vue中,在注册登录后加载header,但是在注册,修改密码等页面中不需要header,如何合理巧妙的避免header的加载项目中采用根据路由判断,v-if 隐藏掉header,但是笨重又不高效,有什么比较哦好的办法<div id="app">
<HeaderBar v-if='this.$route.path!="/login"
&& this.$route.path!="/register"
&& this.$route.path!="/register/"
&& this.$route.path!="/register/companyTwo"
&& this.$route.path!="/register/companySuc"
&& this.$route.path!="/login/"
&& this.$route.path!="/login/quickLogin"
&& this.$route.path!="/secondTe"
&& this.$route.path!="/secondTeC"
&& this.$route.path!="/threeSuc"
&& this.$route.path!="/threeSucC"
&& this.$route.path!="/findPwd"
&& this.$route.path!="/problem"'>
</HeaderBar>
<router-view />
</div>
添加回答
举报
0/150
提交
取消