JaneLifeBlog
let weixinBoolean = false
const ready = () => {
  if (window.__wxjs_environment === \'miniprogram\') {
    weixinBoolean = true;
  }
};
if (!window.WeixinJSBridge || !WeixinJSBridge.invoke) {
  document.addEventListener(\'WeixinJSBridgeReady\', ready, false);
} else {
  ready();
  window.WeixinJSBridge.on(\'onPageStateChange\', res => {
    console.log(\'res is active\', res.active);
  });
}

if (weixinBoolean) {
    console.log(\'微信小程序\')
}


分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-02
  • 2022-01-18
  • 2021-05-26
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-20
  • 2022-12-23
  • 2021-04-10
  • 2021-12-23
  • 2022-12-23
  • 2021-11-20
相关资源
相似解决方案