1、在app.vue页面添加隐藏导航栏的方法
methods:{
navTitle(){
let navTitle = document.getElementsByTagName('uni-page-head');
navTitle[0].style.display = 'none'
}
}
2、在需要的页面中写方法,判断是否在微信浏览器中
is_weixin(){
return String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger";
}
3、在onShow中判断是否在微信浏览器中,在就执行app.vue中隐藏方法
if(nar.is_weixin()) {
app.navTitle()
}