默认tips为false
this.tips=false
<div v-if="tips" class="weixinTips" id="wechat" >
<img src="images/wx.png" alt="" class="img">
</div>
getLayer() {
// 如果inQQ 为true,证明为手机QQ打开
var inQQ = /qq\s*\//i.test(navigator.userAgent);
// 如果inWX 为true,证明为微信打开
let inWX = /micromessenger\s*\//i.test(navigator.userAgent);
if (inQQ || inWX) {
this.tips = true
} else {
this.tips = false
}
},