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
复现步骤
在组件里面,状态变量与map组合使用时,编译出来后,结果不正确:
this.state.list[activeIndex].list -> var stateName = "list[activeIndex]";
this.state.list[activeIndex].list
var stateName = "list[activeIndex]";
这样编译后,并没有对 list 赋值
render() { const activeIndex = this.state.activeIndex; const list = this.state.list[activeIndex].list.map((item) => { /* const cities = item.destination.split(',').map((city, index2) => { return index2 < 3 ? <Text>{city}</Text> : null; }); */ return this.state.list[activeIndex].type === 'trip' ? ( <TripCard item={item} /> ) : ( <VisaCard item={item} /> ); }); const tabs = this.state.list.map((item, index) => { return ( <Text key={index} onClick={this.onClick} className={activeIndex === index ? 'active' : ''} data-index={index} >{item.name} </Text> ); }); return ( <View> <View className="b_con"> <Image className="head_b_c" src={labelImg} /> <Text className="b_j">{this.props.title}</Text> </View> <View className="b_nav">{tabs}</View> <View className="boutique_fu"> <View className="a active">{list}</View> </View> </View > ); }
期望行为
在_createData里面,需要对 this.state.list[activeIndex].list 进行动态封装
报错信息
这里 stateName 不对,应该是动态进行赋值
_this.$dynamicComponents = { $756388a7: function $756388a7() { var stateName = "list[activeIndex]"; ... return { stateName: stateName, loopComponents: index_js_1.internal_dynamic_recursive(_this, nodes, index_js_1.internal_safe_get(_this.state, stateName), "$756388a7") }; } };
系统信息
补充信息 [可选]
如果把上面注释的代码(多余的),解注释,编译结果是正确的
The text was updated successfully, but these errors were encountered:
遇到了同样的问题~
Sorry, something went wrong.
05bc781
yuche
No branches or pull requests
复现步骤
在组件里面,状态变量与map组合使用时,编译出来后,结果不正确:
this.state.list[activeIndex].list
->var stateName = "list[activeIndex]";
这样编译后,并没有对 list 赋值
期望行为
在_createData里面,需要对 this.state.list[activeIndex].list 进行动态封装
报错信息
这里 stateName 不对,应该是动态进行赋值
系统信息
补充信息
[可选]
如果把上面注释的代码(多余的),解注释,编译结果是正确的
The text was updated successfully, but these errors were encountered: