wepy 在onLoad中发送请求,this.$parent并不能拿到值

31moq8wy  于 2022-10-20  发布在  其他
关注(0)|答案(2)|浏览(162)

提交ISSUE前请确保已认真阅读以下内容

  • Please read the following information carefully before you open an issue.*

在提交issue之前必须确认以下问题:

  • Please make sure you understand the following points:*

  • 必须是一个bug或者功能新增。

  • It must be a bug or a feature request

  • 必须是WePY相关问题,原生小程序问题去 开发者论坛

  • It must be a WePY issue.

  • 已经在issue中搜索过,并且没有找到相似的issue或者解决方案。

  • I searched issue already but I did't find any relevant issues or solutions.

  • 完善下面模板中的信息

  • Please filled out the following template

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

DELETE THE INFORMATION ABOVE(INCLUDE THE SEPARATION LINE) BEFORE YOU OPEN AN ISSUE

Description

[问题描述:站在其它人的Angular 尽可能清晰地、简洁地把问题描述清楚]

[Description of the issue]

Environment

  • Platform: [开发者工具/iOS/Andriod/Web]
  • Platform version: [对应工具或者iOS或者Andriod的版本号]
  • Wechat version: [微信版本号]
  • wepy-cli version: [wepy-cli -v]
  • wepy version: [在package.json里]
  • other version: [如果是插件问题,请列出问题插件的版本号]

Reproduce

[如何重现问题]

[How to reproduce the issue]

Observed Results

[实际表现]

[Observed Results]

Expected Results

[期望表现]

[Expected Results]

Relevant Code / Logs

// TODO(you): code or logs here to reproduce the problem
 // 可以使用小程序代码片段功能,方便其它人帮助你定位代码问题
 // 详情可参考这里:https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
 ```
klh5stk1

klh5stk11#

抱歉,重新描述下
onLoad(){
this.$parent.hanshu(this.login)//undefined
this.login()//具体值
}
login(){
console.log(this.$parent)
}
为什么呢?

iecba09b

iecba09b2#

我也遇到相同的问题了,不知道你解决了没有

相关问题