-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 中三元运算,判断条件是一个计算出来的变量的话,true和false都会被执行 #1698
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
能不能写真代码,伪代码没法复现。 还有,你版本和平台也没有写,全靠我瞎猜。 |
CC @yuche |
不好意思,忘了, 版本是1.1.4, 平台是小程序 |
那你能不能写一个可以复现的代码。 还有能不能一下把话说完,不要开了 issue 还想语音聊天一样时不时进来 check 一下你有没有回消息。 |
render() {
const range = ['a', 'b', 'c']
const isMulitPickerView = range ? isArray(range[0]) : false
return (
!isMulitPickerView ? (
<PickerView className="popup-view">
<PickerViewColumn className="popup-view-column">
{
range && range.map((item, index) => {
console.log('singleSelect')
return isObject(item) ? (<View key={index}>{ item[rangeKey] }</View>) : (<View key={index}> { item }</View>)
})
}
</PickerViewColumn>
</PickerView>
) : (
<PickerView className="popup-view">
{
range && range.map((items, index) => {
console.log('mulitSelect', items)
return (
<PickerViewColumn key={index} className="popup-view-column">
{
items.map((item, index) => {
return isObject(item) ? (<View key={index}>{ item[key] }</View>) : (<View key={index}> { item }</View>)
})
}
</PickerViewColumn>
)
})
}
</PickerView>
)
)
}
组件全部代码太多。抽了主要的代码,复制过去,套个外壳,应该能重现出来 |
升级一下到最新版本,用 最新的版本还没有处理三元表达式 |
伪代码
The text was updated successfully, but these errors were encountered: