Skip to content
关注公众号,获取新课通知

uni.postMessage is not a function 错误

报错如下:

uni-app实战商城问题汇总/5/1

解决方案:

app.vueonLaunch 里面写监听

js
uni.$on("postMessage", (e) => {
  console.log(e);
});

其他地方传值调用

js
uni.$emit("postMessage", "传递的参数");