Open wuazhu opened 3 years ago
微信小程序
https://git.jd.com/MP_FE/speedjd 小程序基础库: 2.17.3 使用框架: React
项目是微信源码使用 taro convert 转换成了 taro3 的 react, 在微信组件里有 pageLifetimes 里面有 show 生命周期, 但是转换后的代码不执行这个生命周期
代码如下
@withWeapp({ pageLifetimes: { show() { // 这里无法进入 this.changeAddress() } }, methods: { changeAddress() { console.log('change address') } } }) class _C extends Component { ... }
执行生命周期
不执行 pageLifetimes 里的生命周期
Taro v3.2.10 Taro CLI 3.2.10 environment info: System: OS: macOS 10.15.6 Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.20.1 - ~/.nvm/versions/node/v12.20.1/bin/node npm: 6.14.10 - ~/.nvm/versions/node/v12.20.1/bin/npm npmPackages: @tarojs/cli: 3.2.10 => 3.2.10 @tarojs/components: 3.2.10 => 3.2.10 @tarojs/helper: 3.2.10 => 3.2.10 @tarojs/mini-runner: ^3.2.10 => 3.2.10 @tarojs/plugin-platform-alipay: ^3.2.10 => 3.2.10 @tarojs/plugin-platform-jd: ^3.2.10 => 3.2.10 @tarojs/plugin-platform-qq: ^3.2.10 => 3.2.10 @tarojs/plugin-platform-swan: ^3.2.10 => 3.2.10 @tarojs/plugin-platform-tt: ^3.2.10 => 3.2.10 @tarojs/plugin-platform-weapp: ^3.2.10 => 3.2.10 @tarojs/react: 3.2.10 => 3.2.10 @tarojs/router: 3.2.10 => 3.2.10 @tarojs/runner-utils: 3.2.10 => 3.2.10 @tarojs/service: 3.2.10 => 3.2.10 @tarojs/shared: 3.2.10 => 3.2.10 @tarojs/taro: 3.2.10 => 3.2.10 @tarojs/taro-h5: 3.2.10 => 3.2.10 @tarojs/taro-loader: 3.2.10 => 3.2.10 @tarojs/taroize: 3.2.10 => 3.2.10 @tarojs/webpack-runner: 3.2.10 => 3.2.10 @tarojs/with-weapp: ^3.2.10 => 3.2.10 babel-preset-taro: ^3.2.10 => 3.2.12 eslint-config-taro: 3.2.10 => 3.2.10 eslint-plugin-taro: 3.2.10 => 3.2.10 react: ^17.0.2 => 17.0.2 npmGlobalPackages: typescript: 4.2.3
坐等官方解决
相关平台
微信小程序
复现仓库
https://git.jd.com/MP_FE/speedjd 小程序基础库: 2.17.3 使用框架: React
复现步骤
项目是微信源码使用 taro convert 转换成了 taro3 的 react, 在微信组件里有 pageLifetimes 里面有 show 生命周期, 但是转换后的代码不执行这个生命周期
代码如下
期望结果
执行生命周期
实际结果
不执行 pageLifetimes 里的生命周期
环境信息