Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.2.5微信小程序Taro.getCurrentInstance().preloadData无法获取到preload数据 #9175

Closed
xiayuqing opened this issue Apr 24, 2021 · 1 comment · Fixed by #9265
Closed
Labels
T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@xiayuqing
Copy link

相关平台

微信小程序

小程序基础库: 2.14.1
使用框架: Nerv

复现步骤

Taro.preload({ arg: '123' });

// 目标页面获取到的 preloadData 为 undefined
const preloadData = Taro.getCurrentInstance().preloadData;

期望结果

Taro.getCurrentInstance().preloadData能正确获取到 Taro.preload 的数据。

实际结果

目标页面Taro.getCurrentInstance().preloadData为 undefined

环境信息

👽 Taro v3.2.5


  Taro CLI 3.2.5 environment info:
    System:
      OS: macOS 11.2.2
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 10.16.0 - /usr/local/bin/node
      Yarn: 1.7.0 - /usr/local/bin/yarn
      npm: 6.14.5 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 3.2.5 => 3.2.5 
      @tarojs/mini-runner: 3.2.5 => 3.2.5 
      @tarojs/runtime: 3.2.5 => 3.2.5 
      @tarojs/taro: 3.2.5 => 3.2.5 
      @tarojs/webpack-runner: 3.2.5 => 3.2.5 
      babel-preset-taro: 3.2.5 => 3.2.5 
      eslint-config-taro: 3.2.5 => 3.2.5 
      nervjs: 1.5.7 => 1.5.7 
      taro-ui: 2.3.0 => 2.3.0 
@ycyeye
Copy link

ycyeye commented May 24, 2021

这么一改, 原来 Taro.preloadData 的就取不到值了, 需要 Taro.Current.preloadData 希望可以固定一下这个 api 不要总是变 @Chen-jj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants