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

A页面 preload传参 B页面获取undefined #5252

Closed
PlutoCA opened this issue Jan 6, 2020 · 5 comments
Closed

A页面 preload传参 B页面获取undefined #5252

PlutoCA opened this issue Jan 6, 2020 · 5 comments
Assignees

Comments

@PlutoCA
Copy link

PlutoCA commented Jan 6, 2020

问题描述

在A页面使用this.$preload 传参 跳转到B页面 ,B页面的componentWillMount this.$router.preload 打印出来undefine

复现步骤

    // a页面传参跳转
     this.$preload({
        data,
        num,
      })
      Taro.navigateTo({
        url: '/pages/confirm_order/confirm_order'
      })

   // B页面接收
 componentWillMount () {
    console.log('preload: ', this.$router.preload) // undefined
  }

image

期望行为

能获取到A页面传过来的参数

报错信息

undefined

系统信息

Taro CLI 1.3.31 environment info:
    System:
      OS: Linux 4.4 Ubuntu 18.04.2 LTS (Bionic Beaver)
      Shell: 4.4.19 - /bin/bash
    Binaries:
      Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
      Yarn: 1.19.1 - /mnt/c/Program Files (x86)/Yarn/bin/yarn
      npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm
    npmPackages:
      @tarojs/async-await: 1.3.31 => 1.3.31 
      @tarojs/components: 1.3.31 => 1.3.31 
      @tarojs/plugin-babel: 1.3.31 => 1.3.31 
      @tarojs/plugin-csso: 1.3.31 => 1.3.31 
      @tarojs/plugin-sass: 1.3.31 => 1.3.31 
      @tarojs/plugin-uglifyjs: 1.3.31 => 1.3.31 
      @tarojs/router: 1.3.31 => 1.3.31 
      @tarojs/taro: 1.3.31 => 1.3.31 
      @tarojs/taro-alipay: 1.3.31 => 1.3.31 
      @tarojs/taro-h5: 1.3.31 => 1.3.31 
      @tarojs/taro-qq: 1.3.31 => 1.3.31 
      @tarojs/taro-quickapp: 1.3.31 => 1.3.31 
      @tarojs/taro-swan: 1.3.31 => 1.3.31 
      @tarojs/taro-tt: 1.3.31 => 1.3.31 
      @tarojs/taro-weapp: 1.3.31 => 1.3.31 
      @tarojs/webpack-runner: 1.3.31 => 1.3.31 
      eslint-config-taro: 1.3.31 => 1.3.31 
      eslint-plugin-taro: 1.3.31 => 1.3.31 
      nerv-devtools: ^1.5.5 => 1.5.6 
      nervjs: ^1.5.5 => 1.5.6 
      stylelint-config-taro-rn: 1.3.31 => 1.3.31 
      stylelint-taro-rn: 1.3.31 => 1.3.31 

补充信息

如果您有功能上的建议,可以提到 FeatHub

使用上的问题,欢迎在「Taro 社区」一起交流

@taro-bot
Copy link

taro-bot bot commented Jan 6, 2020

CC @Chen-jj

@taro-bot
Copy link

taro-bot bot commented Jan 6, 2020

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@Chen-jj
Copy link
Contributor

Chen-jj commented Jan 6, 2020

@PlutoCA 复现不了,升级到最新版本后再试试吧。

image

image

@PlutoCA
Copy link
Author

PlutoCA commented Jan 6, 2020

@PlutoCA 复现不了,升级到最新版本后再试试吧。

image

image

刚刚我跑了个demo看了下 好像是OK的,我找找我这边的代码的问题

@PlutoCA
Copy link
Author

PlutoCA commented Jan 6, 2020

对不起 我的问题,代码调用错了
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants