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

render时子组件返回null #2781

Closed
MikyChow opened this issue Apr 16, 2019 · 2 comments
Closed

render时子组件返回null #2781

MikyChow opened this issue Apr 16, 2019 · 2 comments

Comments

@MikyChow
Copy link

问题描述
在render中使用if判断状态然后判断返回子组件时编译后直接返回null

复现步骤
[复现问题的步骤]

  1. 创建子组件并引用
  2. 使用if判断当前状态是否需要展示子组件
  3. 编译weapp后js代码中为null

BWLK6JXNC6TJX0}H_F08Q07

期望行为
返回子组件
报错信息
无报错

[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]
使用if关键字导致编译错误、但是未提示。修改成三元运算符后能解决但是相当不好维护

@taro-bot
Copy link

taro-bot bot commented Apr 16, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@yuche
Copy link
Contributor

yuche commented Apr 16, 2019

Duplicate of #2367

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