杭州网帮你
uniapp js 全局微信浏览器不显示导航
时间:2021-05-30 22:02:18 浏览:132

uniapp js 全局微信浏览器不显示导航,直接上代码。


如下:app.vue文件中


onLoad() {
if (this.is_weixin()) {


}
},
onShow: function() {
// console.log('App Show')

},
onHide: function() {
//    console.log('App Hide')
},
methods: {
is_weixin() {
let ua = window.navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {//判断微信
let style = document.createElement('style');
style.type = 'text/css';
style.innerHTML="uni-page-head,.uni-page-head{display:none;}";
document.getElementsByTagName('head').item(0).appendChild(style);
}
}

}


[上一篇]PHP电话号码substr_replace替换星
[下一篇]uniapp ifdef编译不同的平台实例
Copyright 2022 © 93580.com.cn 网帮你

2022 © 版权所有 红花岗区网帮你信息技术工作室

工信部备案号:黔ICP备2024036985号-2

请使用网帮你微信扫码登录