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

V1.2.26 支付宝小程序内传递事件在子组件内无法调用,微信内正常 #4033

Closed
TigerHee opened this issue Aug 1, 2019 · 7 comments
Labels
question Further information is requested

Comments

@TigerHee
Copy link
Contributor

TigerHee commented Aug 1, 2019

Feature Request 请提到 FeatHub

Taro 使用上的问题请提到 Taro 社区——让每一次交流被沉淀

如果是提交 bug,请搜索文档和 issue,确认以下事项:

  • 该问题没有在其他 issue 和文档讨论到,不属于重复内容

  • 分割线以下的模板除了「 补充信息」每一样都必填

如果不满足以上两点要求的 bug 报告,issue 会被直接关掉。

请多多理解,您现在的不便将会使 Taro 开发者更高效地定位你的问题,修复你的问题。像你一样的 Taro 的使用者也可以通过搜索找到你提供的 bug,对各方都有很大好处。

🙏🙏🙏
阅读完后请在提交的issue中删除以上内容,包括分割线。

问题描述
V1.2.26 支付宝小程序内传递事件在子组件内无法调用,微信内正常

复现步骤

父组件:
- 引用子组件并传递事件到子组件:
<FilterLayout
  filterObj={filterObj}
  isFilterLayoutShow={isFilterLayoutShow}
  on_hideFilterLayout={this._hideFilterLayout}
  on_filterData={this._filterData}
/>

子组件:
调用父组件传递过来的事件:
_sure = () => {
    const { renderFilter } = this.props
    const newFilter = cloneDeep(renderFilter)
    this.props.onUpdateResultState({
      userFilter: newFilter
    })
    this.props.on_filterData(newFilter)
    this.props.on_hideFilterLayout()
}

期望行为
能够正常调用传递的事件

报错信息

微信小程序内正常使用,支付小程序并没有调用props事件

系统信息

Taro v1.2 及以上版本已添加 taro info 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。

  • 操作系统: OS: Windows 10
  • Taro 版本 .2.26
  • Node.js 版本 8.10.0
  • 报错平台 支付宝小程序

补充信息
通过打印props发现,传递过来的funtion变成了字符串

@taro-bot
Copy link

taro-bot bot commented Aug 1, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@Chen-jj
Copy link
Contributor

Chen-jj commented Aug 1, 2019

@TigerHee 升级到 1.3.11 后再试试

@Chen-jj Chen-jj added answered question Further information is requested labels Aug 1, 2019
@taro-bot taro-bot bot added the to be closed label Aug 1, 2019
@taro-bot
Copy link

taro-bot bot commented Aug 1, 2019

Hello~

您的问题楼上已经有了确切的回答,如果没有更多的问题这个 issue 将在 15 天后被自动关闭。

如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。

Good luck and happy coding~

@TigerHee
Copy link
Contributor Author

TigerHee commented Aug 1, 2019

@TigerHee 升级到 1.3.11 后再试试

升级taro-cli1.3.11并更新项目中 Taro 相关的依赖,再编译一直提示:缺少npm包regenerator-runtime/runtime,开始安装...

报错信息如下:
缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... 缺少npm包regenerator-runtime/runtime,开始安装... npm ERR! code ELIFECYCLE npm ERR! errno 3221225725 npm ERR! [email protected] build:weapp:taro build --type weapp "--watch"`
npm ERR! Exit status 3221225725
npm ERR!
npm ERR! Failed at the [email protected] build:weapp script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\caihong\AppData\Roaming\npm-cache_logs\2019-08-01T06_33_12_955Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 3221225725
npm ERR! [email protected] dev:weapp: npm run build:weapp -- --watch
npm ERR! Exit status 3221225725
npm ERR!
npm ERR! Failed at the [email protected] dev:weapp script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\caihong\AppData\Roaming\npm-cache_logs\2019-08-01T06_33_12_984Z-debug.log
`

@TigerHee
Copy link
Contributor Author

TigerHee commented Aug 1, 2019

@Chen-jj

@Chen-jj
Copy link
Contributor

Chen-jj commented Aug 1, 2019

@TigerHee node_modules 删掉重装试试

@TigerHee
Copy link
Contributor Author

TigerHee commented Aug 1, 2019

@Chen-jj 嗯,是需要删掉重装,已经接近问题,谢谢

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

No branches or pull requests

2 participants