taro 微信小程序中WebView,onMessage无法响应h5 postMessage过来的数据

t9aqgxwy  于 5个月前  发布在  其他
关注(0)|答案(2)|浏览(64)

相关平台

微信小程序

复现仓库

https://github.com/hooliy/traodemo.git
小程序基础库: 2.32.0
使用框架: React

复现步骤

每次只在这个文件中输出日志,但是onMessage并没有执行

期望结果

实际结果

环境信息

👽 Taro v3.6.6

  Taro CLI 3.6.6 environment info:
    System:
      OS: macOS 13.3.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 16.17.0 - /usr/local/bin/node
      Yarn: 1.22.19 - /usr/local/bin/yarn
      npm: 9.6.6 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.6 => 3.6.6 
      @tarojs/components: 3.6.6 => 3.6.6 
      @tarojs/helper: 3.6.6 => 3.6.6 
      @tarojs/plugin-framework-react: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-alipay: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-h5: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-jd: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-qq: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-swan: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-tt: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-weapp: 3.6.6 => 3.6.6 
      @tarojs/react: 3.6.6 => 3.6.6 
      @tarojs/runtime: 3.6.6 => 3.6.6 
      @tarojs/shared: 3.6.6 => 3.6.6 
      @tarojs/taro: 3.6.6 => 3.6.6 
      @tarojs/webpack5-runner: 3.6.6 => 3.6.6 
      babel-preset-taro: 3.6.6 => 3.6.6 
      eslint-config-taro: 3.6.6 => 3.6.6 
      react: ^18.0.0 => 18.2.0

相关问题