We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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方法之外的方法返回一个组件(即使该方法没有在render中调用),最终也会输出到生成的模版中,最终编译结果类似如下:
<template> <template> ...该处为调用的方法返回的模版 </template> <div> .... </div> </template>
复现步骤 在脚本定义一个方法用来返回一个组件
renderList() { const {listData} = this.state; return listData.map((item,index) => { return <MovieItem data={item} key={item._key} />; }); } render() { const {errorOpts = {}, isLoadingMore, adData = {}, popupModule} = this.state; const bannerData = adData[AD_CODE.indexBanner]; const ballData = adData[AD_CODE.ballArea]; const isNoPageError = !errorOpts.isShow; const isShowPopup = popupModule && isNoPageError; return ( <View> {isNoPageError && ( <View className="now-showing-list"> {this.renderList()}//此处不管是否实际调用最终该方法中的View都会输出 {isLoadingMore && <AtLoadMore isLoading={true} />} </View> )} {!isNoPageError && <PageError opts={errorOpts} onClick={this.handleErrorBtnClk} />} </View> ); }
期望行为 能够正确以div标签包括调用方法生成的组件内容
系统信息
The text was updated successfully, but these errors were encountered:
欢迎提交 Issue~
如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏
如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。
Good luck and happy coding~
Sorry, something went wrong.
luckyadam
No branches or pull requests
问题描述
在脚本中如果有除了render方法之外的方法返回一个组件(即使该方法没有在render中调用),最终也会输出到生成的模版中,最终编译结果类似如下:
复现步骤
在脚本定义一个方法用来返回一个组件
期望行为
能够正确以div标签包括调用方法生成的组件内容
系统信息
The text was updated successfully, but these errors were encountered: